Greetings,
First, I have no experience with JavaScript.
I have a PDF Form (Adobe Acrobat X Pro) with a dollar amount. Based upon that dollar amount a certain signature (text box) must be completed. Upon the mouse down action for the Save Form button, I need to validate that there is an entry for the correct signature (again, based upon the dollar amount).
My weak pseudo code for this would be:
If (dollarAmount > 0) and (dollarAmount < 100) and (signature1 == "") then printToScreen ("Requires Signature1")
else if (dollarAmount > 101) and (dollarAmount < 200) and (signature2 == "") then printToScreen ("Requires Signature2")
else if (dollarAmount > 201) and (signature3 == "") then printToScreen ("Requires Signature3")
Any and all help would be appreciated. Thank you.
This script will do what you describe in your pseudo-code, but be aware it's not handling the following situations:
- dollarAmount is empty
- dollarAmount is exactly 100
- dollarAmount is exactly 200
var dollar = +this.getField("dollarAmount").value;
var signature1 = this.getField("signature1").value;
var signature2 = this.getField("signature2").value;
var signature3 = this.getField("signature3").value;
if (dollar>0 && dollar<100)
if (signature1=="") {
app.alert("Requires Signature1");
}
} else if (dollar>101 && dollar<200) {
if (signature2=="") {
app.alert("Requires Signature2");
}
} else if (dollar>201) {
if (signature3=="") {
app.alert("Requires Signature3");
}
}
North America
Europe, Middle East and Africa
Asia Pacific