Skip to main content
Participant
February 6, 2025
Answered

How to re-hide fields after Reset A Form action

  • February 6, 2025
  • 1 reply
  • 553 views

Checkbox LICENSES has a Mouse Up action to hide/show textbox Text4 with the following script:

if (event.target.value === "Off") {
this.getField("Text4").display = display.hidden;
} else {
this.getField("Text4").display = display.visible;
}

 

Button Clear Form has a Mouse Up action to reset a form.

 

I checked the checkbox LICENSES, textbox Text4 appears so I can enter some information.

When I clicked on the Clear Form button, the checkmark was cleared from checkbox LICENSES and the information I entered was cleared from textbox Text4. However the textbox Text4 itself stays visible.

 

How to re-hide all fields that were originally hidden after I Reset A Form?

 

Thank you.

Correct answer Nesa Nurani

Remove script from checkbox and use this as custom calculation script of "Text4" field:

var f = this.getField("LICENSES").valueAsString;
event.target.display = (f === "Off") ? display.hidden : display.visible;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
February 6, 2025

Remove script from checkbox and use this as custom calculation script of "Text4" field:

var f = this.getField("LICENSES").valueAsString;
event.target.display = (f === "Off") ? display.hidden : display.visible;
Participant
February 6, 2025

Thank you so much for the fast response 🙂