I have a checkbox, a dropdown, and a signature field.
If the box is checked or the dropdown is set to a certain value, the signature field needs to be Required. If the checkbox is unchecked and the dropbox is not set to that certain value, then the signature field needs to be not required.
It appears the checkbox is changing the requirement value every time it is checked or unchecked, regardless of the value of the dropdown. It is triggering at the correct time, just not setting the requirement value correctly. The alerts are showing correctly what the document should be doing, but the requirement value is changing incorrectly.
Can anyone see what is wrong with this code that is giving me this weird behavior?
function ReqSignature()
{
var ReorderReason = this.getField('ReorderReason');
var Signature = this.getField('Signature1');
var ChangedAddress = this.getField('ChangedAddress');
if (ReorderReason.value == 'New Card' || ChangedAddress.value == 'Yes')
{
app.alert('In condition 1');
Signature.required = (event.target.value!=='Off');
app.alert('Set to Req');
}
else if (ReorderReason.value != 'New Card' && ChangedAddress.value != 'Yes')
{
app.alert('In condition 2');
Signature.required = (event.target.value=='Off');
app.alert('Set to not Req');
}
}