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

How to get export value of selected item in comboBox in Acrobat 6.0?

reshma.gyadav
Registered: Jan 25 2007
Posts: 7
Answered

hi,
 
Currently I'm working with Acrobat 6.0 version.
Problem : I have a combo Box "DoctorType_1" which populates the list of doctors. when I select a value from a combo box, appropriate export value is returned on Acrobat 5.0 and corresponding details are populate and shown in textboxes.
 
this.getField("DoctorType_1").value return me proper value on Acrobat 5.0
 
But when same statement is executed on Acrobat 6.0 it retuns undefine values when I select value from combo box first time but when I select value from comboBox 2nd time than it shows the details of previously selected item.
Even I tried using event.Value, But event.value returns me the selected combobox value and not the export value of selected item.
 
Can you please tell me how can I get the export value of selected iteam in comboBox and which will work on both Acrobat 5.0 , 6.0.

My Product Information:
Acrobat Standard 6.0.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Which event are you using to run your code? This is very important. The choice of event will determine which properties are valid.

There are several differences between Acrobat 5 and Acrobat 6 in how lists are handled. For example, Acrobat 5 returns the export and Acrobat 6 returns the display text for the field "value" property. Also there is no "commitOnSelChange" in Acrobat 5.

The proper methodology for 6 and later is to use the "Keystroke" event with the "event.change" value. If the field set to "commitOnSelChange", or you use any of the later events like "Format", then use "event.value"
To acquire the export value use the "getItemAt()" function. You'll also want to use the "even.willCommit" flag in the "keystroke" event to keep the code from being executed twice.

If you really need to support Acrobat 5 you'll need to add in code using "app.viewerVersion" to separate the parts.

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