Hi Folks,
I have JS code that should change some control values when a user wanted to cancel the supply request. User should put in some comments and then click the "Confirm cancellation - Sign" button. The associated code puts the current user's info in the signature block, puts the current date in the date field, and changes the Cancel check box to true. This works initially.
If the user decides not to cancel or clicks the button in error, there is an "Undo" button that clears all values (check box to false). Upon clicking the "Confirm cancellation - Sign" button again, everything works except the check box.
//=============================; // Cancellation Controls; //=============================; function signCancellation() { var curDate = new Date(); NWF$('#'+ jsvar_CancellationSignature_TXT).val(NWF$('#'+ jsvar_CurrentUserPreferredName_CAL).val() +" (Current User)"); NWF$('#'+ jsvar_CancellationDate_DTE).val((curDate.getMonth() + 1) + '/' + curDate.getDate() + '/' + curDate.getFullYear()); NWF$('#'+ jsvar_CancellationCheck_CHK).attr('checked',true); } //=============================; function resetCancellation() { NWF$('#'+ jsvar_CancellationComments_MLT).val(""); NWF$('#'+ jsvar_CancellationSignature_TXT).val(""); NWF$('#'+ jsvar_CancellationDate_DTE).val(""); NWF$('#'+ jsvar_CancellationCheck_CHK).attr('checked',false); } //=============================;
This is what the form section looks like when the user puts in some comments and clicks the "Confirm cancellation - Sign" button.
This is what the form looks like after clicking the "Undo" button.
Upon clicking the "Confirm cancellation - Sign" button again, the code works except for the checkbox...
Does anyone understand thios behavior and knows a workaround?
Thanks and Regards,
Patrick