How to Get Item Value from Drop-down List
Hello All,
I have zero experience in Acrobat Form with multiple selections and foray into drop-down list. Referring to Mr. Thom Parker's article of "Programming list and combo fields in Acrobat and LiveCycle forms - Part 1 of 2", I have learned from you a lot. The example file "ListProgramming_Part1_AcroForm.pdf" is exactly what I need.
I tried to export into .csv file in Excel and would like to display "item value" in the spreadsheet as opposed to "export value" from Drop-down List "Part" . For this purpose, I have googled and acquired some basic knowledge from JavaScript for Acrobat API Reference.
Based on the example file, I added the codes below extra into "Example1" document JavaScript, which contains scripts created.
function expPartValue() {
if(!event.willCommit){
var cRowName = event.target.name.split(".").shift();
var f = this.getField(cRowName + ".PartSelect");
var a = f.currentValueIndices;
console.println(f.getItemAt(a, false));
}
}
In order to test, calling “expPartValue()” function from a the Keystroke Event of "PartSelect" field, the results are displayed in the console window of JavaScript Debugger. Regardless it may be ok with me.(For sure, it is flawed.)

When I replaced "console.println(f.getItemAt(a, false));" with
"event.value = f.getItemAt(a, false);", it does meet the expectation.
May I ask a question about how I can get item value. I am wondering whether the codes are wrong. Any advices from you are highly appreciated.