Form created with Acrobat X Pro
Linked to a DB to auto fill various Fields, some directly (i.e. Field is directly filled from DB just by matching Field Name on form) and some after manipulation (i.e. hidden Field gets the content, which is subsequently written to the approrpiate visible fields by some JS).
When the form is produced, although a user can delete or overwrite a Field initially, as soon as they activiate a subsequent field the JS for the original field goes to work and replaces their changes wiuth the autofill content.
I want to be able make the autofill happen once and then be editable.
Thanks in advance
Here is an example of a script that is in a hidden field
The first 3 Fields are also hidden, and get filled from the DB
The next 2 Fields are on the form and are visible:
var cchn = this.getField("ContactFullName");
var ccha = this.getField("ContactAddress");
var cchcsz = this.getField("ContactCityStateZip");
var chldc = this.getField("Chldc1");
var namadd = this.getField("Box1");
namadd.value = cchn.value + "\n" + ccha.value + "\n" + cchcsz.value;
chldc.value = "Yes";
You need to move the code from the calculate event of the target field to the various validation events of the source fields, and possibly add a condition that they only execute if the target field is empty.
There are way too many target fields to hit each one individually - hence the centralization of code in an invisible field.
For my own records, the way I am trying it now puts the big calculation script within an "If" statement that checks the value of a hidden check box, which defaults to "On" when the form opens up for the first time The bottom of the big calc script includes a line to set teh check box to "Off".