This is not a valid command in JS:
if (event.changeEx in gst)
You should be using something like the indexOf method, or a regular expression or something like that.
I know it is not a valid command because it does not work. The first part does work but when I try to use it with a spawned page, and try to alter the script for the renamed field on the spawned page, I do not know how to write it. There must be a way to make it work without rewriting the whole script. I am very new with adobe scripting and can use some help. Thanks
Okay, I fugured it out myself. this works:
var fna = event.target.name.split(".");
var fp = fna.length>1?fna+"."+fna+".":"";
var stateamt = this.getField(fp + "G876_StateAmt")
if (event.changeEx in gState)
stateamt.value = gState[event.changeEx]
I did not totally understand the script and was trying to change the wrong part. It is still using the array gState and I needed to change the textbox getting the information from the array.