I want to have a drop-down's export value change depending on a text field. Is there a way to do that?
Yes, here is an article on programming list/dropdown fields
However, this may not be a very practical solution. What is it that you are trying to do?
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.
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.
Change export value of an existing entry.
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");
var nIdx = oListField.currentValueIndices;
var strName = oListField.getItemAt(nIdx,false);
I'm not sure if i understand this. I am very new to adobe and coding.