Field customization based on ComboBox selection

I'm not new to JavaScript, but this is my first foray into Acrobat script.

What I'm trying to do is change the text box based on the value selected in comboBox.

Since I have many different combobox with the same set of options and many text fields that should be attached to these, I would prefer a document area function that could be reused for all of these.

I'm not sure if this is possible, but here is what I think ...

Detect when combo box is changed. In the change event view, take the export value from it and make it the value for the associated text field.

Here are the steps:

  • capture onmouseup combo box
  • determine which combo block caused the event
  • match the name of the combo box with the associated text field using a list of arrays
  • use getField () to retrieve a text field
  • set the value of the text fields as the export value in the combo box

Any help with this would be greatly appreciated. Especially good sources on Acrobat event triggers and how they work. I went through a lot of API documentation and can't find anything on it.

+3
source share
1 answer

Found!

After exhaustive hours / days of Googling, I finally found a solution that works.

The handler function must be bound to the Keystroke event.

The handler function should contain:

if(!event.willCommit) {
  this.getField('[field]').value = event.change;
}

: "" - , event.change - , .

, :

if(!event.willCommit) {
  this.getField('[field]').value = event.changeEx;
}

-, "Keystroke" , . , , .

: AcroForms JS (Javascript Acrobat) . combobox , . , , , AcroForms JS , .

+4

All Articles