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

Can selecting a check box or radio button cause a text box to populate

awheeleravalon
Registered: Sep 15 2009
Posts: 27
Answered

I have a client who wants me to create a form such that when a user answers a question by clicking the "Yes" button/checkbox or the "No" button/checkbox, the word YES or NO will appear in a text field. There would be a series of questions and they would wind up with a bunch of yes-es or nos. I don't need to add up how many yes-es or nos there are.
1) can I do that with Acrobat Pro?
2) If so, what properties do I set for the button/checkbox to make that happen?
Thanks in advance, Amy Wheeler

Amy Wheeler
avalonprojectpartners.com

My Product Information:
Acrobat Pro 9.2, Macintosh
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You probably want to use a check box as that will allow one to uncheck the check box, while once a radio button is selected it can not be unslected without some additional scripting.

If you use one check box, then you can set the 'value' for the checked value to 'Yes' and your text field will need a custom calculation script in the text field. The simplest script could be:
event.value = this.getField('Check Box1').value;if (event.value =='Off') event.value = 'NA'; // adjust for 'Off' or unchecked value

The above code should be changed for the name of the 'Check Box' and the code will also work with 'Yes' and 'No' check boxes or radio buttons.

George Kaiser

awheeleravalon
Registered: Sep 15 2009
Posts: 27
Wow! That's really great! Thanks! I don't know a darn thing about custom scripts, so I hope the next questions are not dumb. 1) If they decide they MUST have a separate version for "No" such that a separate checkbox causes a field to populate with the word "No", what code do I put in the text box's custom calculation to get it to say No, and 2) I noticed that when I check and uncheck the box, I get "NA" in the text box when the box is unchecked. Can I get the text box to just be blank when the checkbox is unchecked?

Amy Wheeler
avalonprojectpartners.com