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

Combo box autopopulate fields

cyfu
Registered: Apr 26 2011
Posts: 32
Answered

Having trouble getting a button (initial property is Hidden), to it's initial state after it becomes visible. Here's the following code in the Custom Keystroke Script:
 
var dialogButton = this.getField("Button1");
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["field1", "field2", "field3", "field4", "field5", "field6"]);
else
setFieldValues(event.value);
dialogButton.display=display.visible;
}
 
I've tried adding the statement: dialogButton.display=display.hidden; after
this.resetForm statement and also tried adding the "Button1" value into the this.resetForm arguments. But it's not working when I select the empty space value in the combo box.

My Product Information:
Acrobat Pro 7.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Is this within a dialog object window?

George Kaiser

cyfu
Registered: Apr 26 2011
Posts: 32
No, the code is within the form. A combo box field, custom keystroke script.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
Does this work?

  1. var dialogButton = this.getField("Button1");
  2.  
  3. if (event.willCommit) {
  4. if(event.value == " ") {
  5. this.resetForm(["field1", "field2", "field3", "field4", "field5", "field6"]);
  6. dialogButton.display = display.hidden;
  7. } else {
  8. setFieldValues(event.value);
  9. dialogButton.display = display.visible;
  10. }
  11. }
cyfu
Registered: Apr 26 2011
Posts: 32
George, working perfectly now.
Thanks...it was the curly brackets...