Skip to main content
ChristiLynn
Participating Frequently
January 28, 2026
Question

Making a text box required ONLY when a certain checkbox is selected in adobe forms

  • January 28, 2026
  • 1 reply
  • 104 views

I want to know how to do this. I’ve tried show/hide fields, javascript… nothing works! help please!

 

1 reply

ls_rbls
Community Expert
Community Expert
January 28, 2026

Hi ​@ChristiLynn ,

 

The best approach is to employ a Mouse Up action script, executed from the desired checkbox.

 

Something like this:

 

(event.target.value !=="Off") ? this.getField("Text4").required = true : this.getField("Text4").required = false

 

Required in this context means that the textbox will be outlined with a red border indicating the user to fill in that textbox.

 

Other methods can be combined too, like employing popups, dialogs or alerts.

 

If you’d prefer to hide the field or make it visible, you may use the same line of code above with a small variation like this:

 

(event.target.value !=="Off") ? this.getField("Text4").display = display.visible : this.getField("Text4").display = display.hidden;

 

ChristiLynn
Participating Frequently
January 28, 2026

Thank you! Where would I put the name of my text field Fixed Fee 1? Also, the checkbox has an export value of No. Do you use the quotation marks and parentheses in the code?

 

I am new to code. Just trying to figure it out. Thanks!

Nesa Nurani
Community Expert
Community Expert
January 29, 2026

In the example script posted by ​@ls_rbls replace Text4 with  Fixed Fee 1.