I have created my list box, have enabled multiple selections and am sending out the interactive pdf.
However when i get it back and extract the data, I will only get one selection in the csv file.
Also I would like to automatically select all the entries in a list box. How would I do that?
Thanks for the help. I have been roaming the Internet for an answer but have not found what I needed yet.
Solved! Go to Solution.
I've been thinking about my problem and I think what would be best to do is to concatenate all the options of a list box in a text box which I would then export.
Can someone help me with the script? I've tried with If, concat... but all to no avail.
Here is a sample: https://acrobat.com/#d=Ac7WhJmi344P4mjEDEVAXg
If you export to XML it will maintain all of the selections in the list box. Alternatively you can set up a hidden textfield to poll the choices in the list box and export that to csv.
Hope that helps,
Sorry, meant to include a snap of the xml data:
I've seen it work in XML but the person who will be evaluating the results needs to see everyting in Excel.
Could you help me on the polling idea? I think that would be the way to go.
As said before I tried with concat etc. but did not get the results. I think I am missing a trivial piece of scripting language to do what I want to.
Thanks for the help.
Were you able to look at the sample?
this.rawValue = ListBox1.rawValue;
The textfield could be set to hidden, so that the user does not see it. You could then export this texfield to the csv file.
You can get the selected values from the list box using the following script.
The multiple values will be separated by a new line character.
var vList = ListBox1.rawValue.split("\n");
var sXML = "";
for (var i = 0; i < vList.length; i++)
xfa.host.messageBox("value " + vList[i]);
Thanks, that works great. If I could only see the automatic select script that was posted beforehand, I would be good to go.
Any chance, you can open it and just post the code?
One more thing Niall,
I have two list boxes where one populates the other with a selection using this script.
How would I be able to make sure that no double entries can appear in the second list box?
Thank a ton,