my acrobat4 pdf form has javascript in many of the fields. One field seems to respond properly to the javascript logic when viewed in acrobat4 but not in adobe reader 7.
I have five fields, the first field has form custom script that will update the other four fields. The PltUnit field is not showing when completing the interface in adobe reader 7. Javascript here is in the PltCnt field:
var pn = this.getField("PltCnt.1");
var pu = this.getField("PltUnit.1");
var pc = this.getField("PltChk.1");
var pw = this.getField("PkgWgt.14");
var wu = this.getField("WgtUnit.14");
var tare = 30;
if (pn.value < 1) {
pc.display = display.hidden;
wu.display = display.hidden;
pw.value = pn.value * tare + 1;
pu.value = "";
}
else if (pn.value == 1) {
pc.display = display.visible;
wu.display = display.visible;
pw.value = pn.value * tare + 2;
pu.value = "Pallet";
}
else if (pn.value > 1) {
pc.display = display.visible;
wu.display = display.visible;
pw.value = pn.value * tare + 3;
pu.value = "Pallets";
}
pu.display = display.visible;
I am doing something similar elsewhere on the form only those fields only impact two other fields, though successfully.
Am I doing something wrong or is there an issue between these versions?
Thanks!
So now you need to debug. Start off by looking at what's displayed in the JavaScript Console, are there any error messages?
Get the JS console for Reader here:
[url=http://www.windjack.com/products/freestuff.php]http://www.windjack.com/products/freestuff.php[/url]
Next, place console.println Staments in your code to report the values returned by the "getField" code. Here's an introduction to using the JS Console.
[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script