var f = this.getField("ComboBoxName");
var a = f.currentValueIndices;
And there's no need to open any more threads about this issue.
Sorry about that. I posted the question and then realized I should have just used the same thread.
Any way, I tried your code and it does not show the current export value. It shows the previously selected value.
When I click item 2 it shows item 0
Then I click item 4 and it shows item 2
Then I click item 7 and it shows item 4.. etc.. (see the pattern)
What I need is the value from the item I'm currently clicking on.
If I click item 2, I expect to see item 2. etc..
Thank you for your patience in answering this!
You might look at what happens when you use
in order to retrieve the return value. It looks as if event.value is still using the value when you entered the field.
I've tried event.changeEx, it returns a blank value.
I've created a stripped down pdf containing a combo box and its values. Is there somewhere I can upload it so you can see what is going on?
Note that it returns nothing if event.willCommit is true, but it does return the export value if it is false.
My friend.. You made my week.
Here's the final code:
this.getField("outputText").value = event.changeEx;
For the combo box, select the "Commit selected value immediately" and use the following script for the 'Custom keystroke' script:
// set text field name to populate
var sField = "Text1";
this.getField(sField).value = event.changeEx;
this.getField(sField).value = event.value;
The script will work for both the mouse selection and the up and down arrow selections.