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

ComboBox with Display and hidden text boxes

Judy7108
Registered: Jan 21 2009
Posts: 14

if (event.change == "R-1") {
("R-1 Desc").display=display.visible;
("R-2 Desc").display=display.hidden;
("R-3 Desc"). display=display.hidden;
if (event.change == "R-2") {
("R-1 Desc").display=display.hidden;
("R-2 Desc").display=display.visible;
("R-3 Desc"). display=display.hidden;if (event.change == "R-3") {
("R-1 Desc").display=display.hidden;
("R-2 Desc").display=display.hidden;
("R-3 Desc"). display=display.visible;
}}}

I cannot figure out why the above code does not work. The event change is a Combo Box with the values of R-1, R-2 and R-3

The "R-1 Desc" etc are text boxes that should appear or disapear depending on the choices made in the Combo Box.

a
Any input would be greatly appreciated.

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Are you getting any errors on the JavaScript debugging console?

Unless the user is typing the value into the text box, I believe you should be using the 'changeEx' property. You also need to get the field object and not the name of the field.

("R-1 Desc").display=display.visible;
Should be coded:
this.getField("R-1 Desc").display=display.visible;

George Kaiser

Judy7108
Registered: Jan 21 2009
Posts: 14
Thanks for your help! I think I am getting closer

var item = event.value;

var a = this.getField("R-1 Desc").value; // variable for Ribbon 1
var b = this.getField("R-2 Desc").value;// variable for Ribbon 2
var c = this.getField("R-3 Desc").value;// variable for Ribbon 3
if (event.change == "R-1") {this.getField("var a").display=display.visible;this.getField("var b").display=display.hidden;this.getField("var c").display=display.hidden;




if (event.change == "R-2") {
this.getField("var a").display=display.hidden;this.getField("var b").display=display.visible;this.getField("var c").display=display.hidden;

if (event.change == "R-3") {
this.getField("var a").display=display.hidden;this.getField("var b").display=display.hidden;this.getField("var c").display=display.visible;}}}