Are these actually text fields or just text on the page. Text fields can be assigned to layers in PDF but there's no mechanism in Acrobat to do it. You'll need a plugin to set that up. If it's just text on (in?) a layer, then you can see code to do that sort of thing at the link below.
Good distinction. I spoke incorrectly. These are not "text fields", it's just text on the page. Sorry about that.
So I looked at the link you provided and I get how that would work if the use was entering a number in, but what if I'm using a drop down menu with names instead? Do i assign each name a number in the "export value" box and do it that way?
Thanks for the help btw.
You may find the coding easier if you set the export values in the list to correspond numerically to the index number of the OCGs in the array but any programming trick that will allow you to associate a value in the list to a certain layer name or index value should work.
For this sort of thing, I tend to put the script that does the work in a custom format script. That's generally not what the format script is used for but I use it because it's always the last event to get triggered before the user exits the field. You wouldn't modify the format of the field in your code, you'd just change the layer properties.