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

Concatenating bound fields into a text field

adobeqs
Registered: Jun 6 2007
Posts: 2

One of the form samples with Acrobat 8 includes a text field whose value is the concatenation of several fields from the XML data source. A script is added to the ready:form event that looks like this:
 
this.rawValue = $record.invoice.area.contactName.value + '\u000a' +
$record.invoice.area.areaName.value + '\u000a' +
$record.invoice.area.address.value + '\u000a' +
$record.invoice.area.city.value + ', ' +
$record.invoice.area.stateProv.value + ' ' +
$record.invoice.area.zipCode.value + '\u000a' +
$record.invoice.area.country.value;
 
Of course, the sample data file has only one record in it and the above script works fine. However, if another record is added to the data, the concatenated value does not change. So the first contact's name and address show on all pages of the form.
 
How can I get the value in this text field to change on each page?

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The DB needs to be moved to the next line. Are you familiar with programming for database access? There are lots of common commands like Next Record, New Record, Update Record. There is a whole set of DataBase functions like there built in to Acrobat. You need to look these up in the Live Cycle XML Object Reference. There are also lots of other documents that explain the XFA programming model (i.e. the LiveCycle programming model) and look on the Acrobat LiveCycle forum.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script