These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Checkbox sets Hidden fields from hidden to "show" but required

latheofheaven
Registered: Nov 3 2011
Posts: 10
Answered

Hi!
 
I created a checkbox that when clicked, reveals hidden text for certain users.
I want the content required for those users only.
 
The submit button will not allow users to send the form without completing ALL fields, however.
 
How can I make the hidden fields "required" but eliminate its restrictions to submit?
 
Codes:
The Checkbox triggers these fields:
var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden;
this.getField("a").display = nHide;
this.getField("b").display = nHide;
this.getField("name").display = nHide;
   
SUBMIT:
"At least one required field was empty. Please fill in . . .

"Things don't have purposes, as if the universe were a machine, where every part has a useful function. What's the function of a galaxy? I don't know if our life has a purpose and I don't see that it matters. What does matter is that we are." Ursula LeGui

My Product Information:
Acrobat Pro 10.0.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
A check-box can't be set to be required because even its Off-state is a valid state.
What you can do, though, is create your own submit procedure (using the submitForm method) and place before it an if-statement that checks if the check-box is indeed checked (if I understood correctly what you want to achieve).

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

latheofheaven
Registered: Nov 3 2011
Posts: 10
Thank you, try67!

"Things don't have purposes, as if the universe were a machine, where every part has a useful function. What's the function of a galaxy? I don't know if our life has a purpose and I don't see that it matters. What does matter is that we are." Ursula LeGui