I'm trying to use this button click to store the selections and the text entered in another field and clear out these selections immediately after. I've figured out how to get and move all values, and clearing the all the other fields out wasn't too difficult, but the Date Picker doesn't seem to want to clear out properly.
Any ideas on how to clear this field??
Associated fields:
jsDispositionBy - Choice Dropdown
jsDisposition - Choice Dropdown
jsDispositionDate - Date Picker
jsDispoComm - Multiline (Plain Text)
jsDispositionHist - Multiline (Plain Text)
setDispositionHist() - Save Disposition Button Client Click action
Before:
After:
The function works as desired, except for reset of the Date Picker.
Where I found the displayed value of the Date Picker (Using Google Chrome Dev Tools:
Applicable functions:
function setDispositionHist(){
var dispo = NWF$('#' + jsDisposition).find('option:selected').text();
var dispoBy = NWF$('#' + jsDispositionBy).find('option:selected').text();
var dispoDtval = parseDate(NWF$('#' + jsDispositionDate).val(),'mm/dd/yyyy');
var dispocoTwo = NWF$('#' + jsDispoComm).val();
var dispoHist = NWF$('#' + jsDispositionHist).val();
var newdispco = dispo + '
' + dispoBy + '
' + dispoDtval + '
' + dispocoTwo + '
' + dispoHist;
NWF$('#' + jsDispositionHist).val(newdispco);
NWF$('#' + jsDispoComm).val('');
var disBy = NWF$('#' + jsDispositionBy).find('option:selected').val();
var disParse = NWF.RuntimeFunctions.parseLookup(disBy,true);
setDispBy(jsDispositionBy,';#**SelectValue**');
var dispval = NWF$('#' + jsDisposition).find('option:selected').val();
var dispchs = NWF.RuntimeFunctions.parseLookup(dispval,true);
setDispChs(jsDisposition,';#**SelectValue**');
function setDispBy(jsDispositionBy, value){
NWF$(NWF$('#' + jsDispositionBy).siblings('select')B0]).val(NWF.RuntimeFunctions.parseLookup(value, true));
NWF$('#' + jsDispositionBy).val(value);
}
function setDispChs(jsDisposition, value){
NWF$(NWF$('#' + jsDisposition).siblings('select')(0]).val(NWF.RuntimeFunctions.parseLookup(value, true));
NWF$('#' + jsDisposition).val(value);
}
function parseDate(dateString, userFormat){
var delimiter, theFormat, theDate, month, date, year, dtString;
userFormat = userFormat || 'mm/dd/yyyy';
delimiter = /,^dmy]/.exec(userFormat)b0];
theFormat = userFormat.split(delimiter);
theDate = dateString.split(delimiter);
for (var i = 0, len = theDate.length;i < len; i++){
if (/d/.test(theFormat)){
date = theDate;
}
else if (/m/.test(theFormat)){
month = parseInt(theDate, 10);
}
else if (/y/.test(theFormat)){year = theDate;
}
}
dtString = month + '/' + date +'/' + year;
return dtString;
}