Dear all,
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.
Cheers,
Larissa
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Steve Walker has a good example of populating listboxes here: Drop-down list automatic add-on
Hope that helps,
Niall
Views
Replies
Total Likes
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.
Thanks,
Larissa
Views
Replies
Total Likes
Hi Larissa,
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,
Niall
ps
Sorry, meant to include a snap of the xml data:
Views
Replies
Total Likes
Hi Niall,
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.
Cheers,
Larissa
Views
Replies
Total Likes
Hi,
Were you able to look at the sample?
The calculate event of the textfield has the following javascript:
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.
Niall
Views
Replies
Total Likes
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
Srini
Views
Replies
Total Likes
Hi Niall,
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?
Thanks,
Larissa
Views
Replies
Total Likes
Hi Srini,
Thanks for this. Would that work when I export into CSV as well or only with XML?
Cheers,
Larissa
Views
Replies
Total Likes
One more thing Niall,
I have two list boxes where one populates the other with a selection using this script.
ListBox0.addItem(xfa.event.newText) in Javascript on the change event.
How would I be able to make sure that no double entries can appear in the second list box?
Thank a ton,
Larissa
Views
Replies
Total Likes
Hi,
Steve Walker has a good example of populating listboxes here: Drop-down list automatic add-on
Hope that helps,
Niall
Views
Replies
Total Likes
Views
Likes
Replies