We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
I have a list box running that is filtered by a text box. On user selection the list box value then populates the text box and is hidden.
The problem i am having is i want to populate the text box with the list box raw/item value rather than the export value if possible.
I will do my best to explain with an example:
- user types "Jan" in text.field.A
- List.Box.B then filters out other months and displays only "January"
- "January" is selected in List.Box.B and value is written into Text.Field.A
The problem i have is January is the item value but the export value i have set is "JanStaffList". I need the "JanStaffList" to be the export value to run another script.
I using the following which gets me the export value
if(!event.willCommit) this.getField("Month").value = event.changeEx
I have tired ".rawValue" ".itemValue" ".valueAsString"
I know there should be a simple solution for this. but i just cant see it.
Any help will be greatly appreciated.
Is this an Acrobat form or an LCD/AEM form?
Hi try67, this is an Acrobat Form. sorry i should have specified this
I thought so, but you mentioned the rawValue property, which only exists for LCD forms, so wanted to make sure... Nesa's solution below should work for you, then.
You can try something like this as "Custom calculation script" of "Month" field:
var f = this.getField("List.Box.B");
var a = f.currentValueIndices;
event.value = f.getItemAt(a, false);
The script approach does work with one kink.
When typing into the text field the list box appears to select from. unfortunately the list box selection does not update dynamically, only after the user clicks away from the list box field. this is a problem in case the user selected the wrong item, it would then not show them changing it.
doesnt work running as a calculation script in the text field for the list box. i tried to modify your script to work in the list box event change to get a dynamic response but it doent want work either and just selects the top value of what is filtered. any other suggestions?
I am actually working with an instrument list 400+ long
var nInstS = this.getField("Instrument") var nList = this.getField("Instrument List") var nListV = nList.currentValueIndices; if(!event.willCommit) nInstS.value = nList.getItemAt(nListV,false); // for Instrument list see document level script nInst
Did you check "Commit selected value immediately" in listbox field properties under options tab?
my apologies, i had forgotten to re-check that after disabling it when running some tests.
the above script works now running in the event change of the list box.
Thank you so much for your help... i had started banging my head against the wall as this was the last thing before finalising the document