I'm preparing a form for users that have drop down boxes 1-7 for each category I am wondering how I tally up all of the items per category and then do a grand total then have the result's pass to a confirmation page??? it will then be emailed think I've figured out most of it except the totalling of the items and passing from one page to another.
Anyway, an empty value will be either an empty string or null. So all you need to test for are these values.
You could put code like this in the calculation event for the "Grand Total" field.
var count = 0;
cont += (d1.rawValue == null || d1.rawValue.length == 0)?0,1;
cont += (d2.rawValue == null || d2.rawValue.length == 0)?0,1;
etc.
If you want to copy the value from one field to another you have 2 options.
1. Give the fields the same name and global binding. This can be a problem if another binding is needed.
2. Do the assignment explicitly in the target fields calculation event. i.e. to copy from Feild A to Field B. Place this code in B's calculate event.
FormCalc: (Very simple, just the Field Name)
A
JavaScript:
this.rawValue = A.rawValue;
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script