Copy link to clipboard
Copied
My form includes check boxes, and when a box is checked, it makes another field (calendar) required. The Reset clears all entries from the form, but the calendar filed remains required. This is my code in the check box:
Run JavaScript
this.getField("Text6").required=event.target.value!="Off";
The format for the calendar field is mm/dd/yy.
The Reset button has all elements selected.
What am I doing wrong?
The Reset Form command actually does trigger some scripts, namely all of the calculation scripts in the file.
So in order to cause it to clear the required property, move the code to the calculation script of the text field and change it to:
event.target.required=(this.getField("Check Box1").value!="Off");
Copy link to clipboard
Copied
The Reset button doesn't execute scripts.
Copy link to clipboard
Copied
Reset sets each field back to its default value - that is the info given as a default. There is no default visibility, default required etc. - if you change these it is permanent.
You can provide a button marked reset which runs a Reset forms action then runs some further scripts to do more resetting to your needs.
Copy link to clipboard
Copied
The Reset Form command actually does trigger some scripts, namely all of the calculation scripts in the file.
So in order to cause it to clear the required property, move the code to the calculation script of the text field and change it to:
event.target.required=(this.getField("Check Box1").value!="Off");
Copy link to clipboard
Copied
try67, thank you! Your answer did the trick.