Skip to main content
ChristiLynn
Participating Frequently
Jan 28, 2026 6:33 PM UTC
Question

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

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

 

16 replies

ls_rbls
Community Expert
Community Expert
Jan 28, 2026 7:12 PM UTC

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;

 

Translate
Technical Generalist
ChristiLynn
Participating Frequently
Jan 28, 2026 9:32 PM UTC

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!

Translate
Nesa Nurani
Community Expert
Community Expert
Jan 29, 2026 6:13 AM UTC

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

Translate