I have created a PDF template using Acrobat7.0 Professional with form fields which are populated through xml tags.
I need to write a conditional statement based on the page number for a form field.
I tried using this.pageNum and this.numPages but I can't get it to work.This is what I am trying to do
eg:
var TotalPages = this.numPages;
var CurrentPage = this.pageNum;
var c_field1= this.getField("FIELD1");
var c_field2 = this.getField("FIELD2");
if (this.CurrentPage == this.TotalPages) {
event.value = c_field1;
} else {
event.value = c_field2;
}
Ive written this script on a form field in the template.However the document runs into many pages.Dependding on the current page(If it is not the last) I need to display a value for the formfield.
Would appreciate if you could help me out.
event.value = c_field1.value;
Of course this only works for AcroForms. It will not work for an XFA form (i.e. built with LiveCycle Designer)
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script