Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Fillable pdf Form
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Fillable pdf Form

 Post Reply Post Reply
Author
MJFan2345 View Drop Down
New Member
New Member


Joined: 27 Dec 2012
Location: NC
Points: 13
Post Options Post Options   Quote MJFan2345 Quote  Post ReplyReply Direct Link To This Post Topic: Fillable pdf Form
    Posted: 28 Oct 2014 at 4:46pm
Good Day~
I put the following in the run custom validation script:
var F1 = this.getField("TRA").value;
var F2 = this.getField("UAR").value;
var F3 = this.getField("IDPY");
var F4 = this.getField("IDPN");
if ( ((F1 >= 4.75) && (F2 == "0")) && (F4.isBoxChecked(0)) ) {
    event.value = RM = "X";
} else if ( ((F1 >= 4.75) || (F2 == "1")) || (F3.isBoxChecked(0)) ) {
    event.value = RM = "";
} else if (F1 <= 4.74) {
    event.value = RM = "";
} else {
    event.value = RM = "";
}
 
It does not work.
 
 
I am trying to get an X in the RM box if the TRA value is 4.75-5.0 AND if the UAR value is not 1 AND if the IDPN is not checked.
 
Please PLEASE help.
Thanks in advance~mjc
Thanks in advance~mjc
Back to Top
Sponsored Links


Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4108
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 2014 at 7:26pm
Have you looked at the JavaScript console for errors?
A validation script is not a calculation script. Validation for the most part should be used to validate the user input.
 
If the field is read only, I would try using the Custom JavaScript calculation to set the field value.
 
If testing for number constant do not put it in quotation marks unless you want it to be treated like a string.
 
Is IDPN a single check box field, multiple check boxes, or another type of field?
 
Do you know if the code is even being triggered?
 
Try this code:
 

console.pritnln("Starting my script", 3, 0);
try {
var F1 = this.getField("TRA").value;
var F2 = this.getField("UAR").value;
var F3 = this.getField("IDPY");
var F4 = this.getField("IDPN");
if ( ((F1 >= 4.75) && (F2 == "0")) && (F4.isBoxChecked(0)) ) {
    event.value = RM = "X";
} else if ( ((F1 >= 4.75) || (F2 == "1")) || (F3.isBoxChecked(0)) ) {
    event.value = RM = "";
} else if (F1 <= 4.74) {
    event.value = RM = "";
} else {
    event.value = RM = "";
}
} catch(e) {
var cMsg = "Processing error has occurred";
for(i in e) {
cMst += "\n" + i + ": " + e;
}
app.alert(cMsg, 1, 0);
} finally {
app.alert("Script ended", 3, 0);
}
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.