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

Help with Checkboxes show/hide field(s)

Diverdown
Registered: Jan 19 2011
Posts: 5
Answered

My form has checkbox that when "checked" should prevent other checkboxes from being displayed. Have tried several variations of code without success. Latest version is:
 
var a = this.getField("Q2a"); //Checkbox to be hidden
if (this.getField("Q1").value == "Yes") //Checkbox used to make show/hide determination
a.display = display.invisible; //hide checkbox "Q2a"
else
a.display = display.visible; //show checkbox "Q2a"
 
Have tried to use "show/hide" function in "Actions" menu for checkbox "Q1" however system goes busy using 100% of memory for five+ minutes when bringing up show/hide fields menu. Decided to use java script instead. Can anyone verify the syntax/code for me? Thank you in advance.

My Product Information:
Acrobat Pro 9.0, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Accepted Answer
Diverdown wrote:
a.display = display.invisible; //hide checkbox "Q2a"

That should be:

a.display = display.hidden;


For more information, see: "display" field property documentation
Diverdown
Registered: Jan 19 2011
Posts: 5
Made change as suggested. Still does not work. Any other ideas???
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Where exactly did you place that code? Are any errors shown in the JavaScript console (Ctrl+J)?
Diverdown
Registered: Jan 19 2011
Posts: 5
George, thanks for the help. Opened Javascript console to find that Q2 was not defined.... syntax error in the code. Should have been "Q2a". Thanks for helping me to get this to work.