Known Participant
September 1, 2020
Answered
Reset button changes field read only option
- September 1, 2020
- 1 reply
- 3352 views
So working on this form and the intention is to keep sub-sections read only unless the main section is checked off. It works but if I hit the clear button after enabling those sub-section fields change to non-read-only (not sure what you would call that).
main section checkbox is using this JS script:
if (this.getField("IL-CHECK").value=="Off") {
this.getField("IL-BK").readonly = true;
this.getField("IL-CL").readonly = true;
this.getField("IL").readonly = true;
this.getField("IL-OTHER").readonly = true;
this.getField("IL-BK-OVG").readonly = true;
this.getField("IL-CL-OVG").readonly = true;
this.resetForm(["IL-BK", "IL-CL", "IL", "IL-OTHER", "IL-BK-OVG", "IL-CL-OVG"]);
} else {
this.getField("IL-BK").readonly = false;
this.getField("IL-CL").readonly = false;
this.getField("IL").readonly = false;
this.getField("IL-OTHER").readonly = true;
this.getField("IL-BK-OVG").readonly = false;
this.getField("IL-CL-OVG").readonly = false;
}
and sub-section checkboxes are using this:
if (this.getField("IL").value == "3")
{
this.getField("IL-OTHER").readonly = false;
}
else
{
this.resetForm(["IL-OTHER"]);
this.getField("IL-OTHER").readonly = true;
}
