Copy link to clipboard
Copied
I want to have a drop-down's export value change depending on a text field. Is there a way to do that?
Thanks
-Austin
Copy link to clipboard
Copied
Yes, here is an article on programming list/dropdown fields
https://acrobatusers.com/tutorials/list_and_combo_in_lc
However, this may not be a very practical solution. What is it that you are trying to do?
Copy link to clipboard
Copied
What I am trying to do is when you enter your email in a form a the end of the PDF there is a submit button and drop-down list that emails based on the selection. And this would get the email that you entered and sticks it into one of the export values of one of the selections on the drop down list.
Copy link to clipboard
Copied
So you want to add entries to a list? Or change the export value of an existing entry?
The article I linked provides a perfect example for adding emails to a list.
Copy link to clipboard
Copied
Change export value of an existing entry.
Copy link to clipboard
Copied
There is no single function for setting a list item value, so assuming the item index is known, the script will need to acquire the current item "Name", delete the item, and then insert the new item using the acquired name and index.
Here's an example, it replaced the export value of the currently selected item. The script is written for a button. You should run it first from the console window to make sure it works.
var cNewVal = this.getField("TextField").valueAsString();
var oListField = this.getField("ListField");
if(oNewValue.length)
{
var nIdx = oListField.currentValueIndices[0];
var strName = oListField.getItemAt(nIdx,false);
oListField.deleteItemAt(nIdx);
oListField.insertItemAt(strName,cNewVal,nIdx);
}
Copy link to clipboard
Copied
I'm not sure if i understand this. I am very new to adobe and coding.