Trying to make my forms more dynamic. I am working on a summer camp registration form and there are some fields that are required to be completed based on the users selection of either Yes or No.
Example, Are there any food allergies? Yes - make the field listing the food allergies required; No - move to the next question
I have other questions based on this condition too. Is there any way I can do this? Using Acrobat Pro DC. Please help - it's greatly appreciated!
All versions of Acrobat and Reader going back many years work the same as far as this type of scripting. And the same is true for Acrobat Professional versions, you can enter this type of script in any of them.
To use a Yes/No radio button group to set other fields to required, takes two scripts, one on each button. The Yes button sets the fields to required, and the No button resets the required property.
I don't know you field names so you'll have to rename them in the script.
Put this code in the MouseUp Action for the Yes Button
this.getField("ReqFld1").required = true;
this.getField("ReqFld2").required = true;
etc. (for each field)
Put this code in the MouseUp Action for the No Button
this.getField("ReqFld1").required = false;
this.getField("ReqFld2").required = false;
etc. (for each field)
Once the field are required how do I make an group contingent upon that yes or no? For example, If yes, click... If no, click.... but I do not want the no options operable when it is yes. Can you help me
Please provide a clearer explanation.
I am creating a form like the one shown below:
Vehicle: Yes No
If Yes, which type: Truck SUV Sedan
If no, will there be a car allowance required?
If the Yes button is click I want to restrict the submitter from answering in the no section. and if they select no for the vehicle I want to restrict them for selecting the type. I would like to make one contingent upon the other. If, then statement. Does that make sense? Thanks, Layne
What you need to do is to set the fields in the Yes and No sections to Read Only. Then use the Yes/No button scripts to enable/disabled the fields in exactly the same way the "required" property is set.
this.getField("ReqFld1").readOnly= false; // or true depending on the button pushed.
Both the "required" and "readOnly" properties need to be balanced. So when Yes is clicked the field in the Yes section are marked as required and readOnly is set to false. But in the same script the fields in the No section need to have required set to false and readOnly set to true.
thank you I will try that. I appreciate you and your time.