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

Reser button does not clear text boxes controlled by radio buttons

awheeleravalon
Registered: Sep 15 2009
Posts: 27

Hi All:
I have a form in which there are two radio buttons, one for yes and one for no. When the user clicks the yes button, "Yes" shows up in a text box nearby, and when the user clicks no, the words "Fraud Risk" show up in a different text box.
This is controlled by code that looks like this:

getField("Text1").display = display.hidden;
getField("Text1a").display = display.hidden;

if(event.target.value == 'Yes')
getField("Text1").display = display.visible;
else if(event.target.value == 'Fraud Risk')
getField("Text1a").display = display.visible;

If, in the text field Options dialog box, I make the default value "yes" or "fraud risk", then the process works fine, but when I click my Reset Form button, the radio buttons clear, but the text box that most recently had text visible remains.
If, in the text field Options dialog box, I leave the default value blank, clicking the radio buttons does not cause the words to appear in the text box. The border will show, but not the words.

What am I missing?
Thanks,
Amy Wheeler

Amy Wheeler
avalonprojectpartners.com

My Product Information:
Acrobat Pro 9.3.1, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Form reset sets all fields to thier default values. It does not do anything with any other field properties. So if the form has some special behavior, then some extra actions or code will need to be added to the reset button to set the form right.

Another issue with reset is that it causes all the calculations to run, so this is another area where extra code is necessary to make sure the calculations act appropiately on reset.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script