HI
I have a drop-down list displaying for instance Apple, Orange, Banana. But I don't want to have the text value displayed when selected but the item value
Value | Text
1 Apple
2 Orange
3 Banana
And you pick Apple I would like to get 1 displayed or as return value.
Any idea with JavaScript?
To get value of dropdown or listbox, it will depends on in which event your script is going to be written.
If you're tring to get the value in dropdown field's own event like change, you'll need to refer to xfa.event.newText for new text changed by user and use it to get the value by using boundItem method.