These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

One Text field to populate 5 other text fields

suewhitehead
Registered: Jun 3 2008
Posts: 232
Answered

I have a text field ccRow12345 that is populated automatically from another field. So ccRow12345 can have one of several numbers in it. If the number in ccRow12345 is 146900 or 128000, I want the text field named AccountRow1 to have 5475003, then the text field named AccountRow2 to have 5175015, then the text field named AccountRow3 to have 5250028.

If any other number is in the ccRow12345 field, I want AccountRow1 to have 7475003 in it, AccountRow2 to have 7175015, and AccountRow3 to have 7250028.

I have gotten confused with this. Can someone help me out, please?

My Product Information:
Acrobat Pro 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You could use something like the following as the custom Validation script for the ccRow12345 field:

// Get field referencesvar f1 = getField("AccountRow1");var f2 = getField("AccountRow2");var f3 = getField("AccountRow3"); // Get this field's valuesVal = event.value; if (sVal === "146900" || sVal === "128000") { f1.value = 5475003;f2.value = 5175015;f3.value = 5250028; } else { f1.value = 7475003;f2.value = 7175015;f3.value = 7250028; }

George
suewhitehead
Registered: Jun 3 2008
Posts: 232
Something is not quite right. I think the problem may lie in this line--

if (sVal === "146900" || sVal === "128000") {

When I put it into my form, if(sVal ==="128000" works, but sVal === "146900' puts in the "ELSE" values.
suewhitehead
Registered: Jun 3 2008
Posts: 232
Nevermind what I just said. I found some leftover script in the calculate tab that was messing it up.

It works perfectly. I appreciate your help and so quick, too!