These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Forgot how to make digital signature required in order to submit acrobat form

rwilki
Registered: Oct 16 2009
Posts: 37
Answered

I think I've done this in the past, but I can't find the javascript to make this happen. I have pdf form that the user can email or print, but I need them to "sign" it first. I know that there's a javascript that checks "get_field" or something like that, but I cannot recall the exact string. Can anyone help?
 
Acrobat Pro 9.x
 
Thanks,
Bob

My Product Information:
Acrobat Pro 9.4.3, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
It depends on how you have the form set up to submit. You cannot prevent printing or saving and manually emailing, whether the signature field is signed or not. If you've set up the form to be attached to an email using the submitForm or mailDoc JavaScript methods, you can first check to see if the field is signed and proceed only if it is. The code fragment would look something like:

if (getField("signature1").value) {

// Go ahead with the submit

} else {

app.alert("Please sign the digital signature field before submitting.");

}

If you're using a submit form action, if you select the Required property of the signature field, the submit process won't be allowed to proceed if the field is not signed.
rwilki
Registered: Oct 16 2009
Posts: 37
Thanks a bunch George. I'm having one problem though... The alert prompt comes up but it still generates the email process.

Here's my javascript code maybe you see something I'm doing wrong...

//
// Before sending the data, make sure that all required
// fields are valid
//
// The "Ex1ValidFields" fucntion is located in the document script
// If you copy this button action then you will also need to delete
// this first if statement or copy the "Ex1ValidFields()"
// fucntion and modify it to work with your form.
//
// This is the form return email, It’s hardcoded
// so that the form is always returned to the same address
// Change address on your form
var cToAddr = "name1 [at] email [dot] com";// Get the client CC email address
var cCCAddr = this.getField("SalesRepTarget1").value;

// Now get the beneficiary email only if it is filled out
var cBenAddr = this.getField("Sales_Rep_Email").value;
if(cBenAddr != "")
cCCAddr += ";" + cBenAddr;

// Set the subject and body text for the e-mail message
var cSubLine = "NRA Advertising Form Returned from "
+ this.getField("Advertiser").value + " "
+ "c/o " + this.getField("Agency").value;

// Set the body text for the email message
var cBody = "Thank you for submitting your form.\n" +
"Save the mail attachment for your own records";

// from George Johnson
if (getField("Customer Signature").value) {

// Go ahead with the submit

} else {

app.alert("Please sign the digital signature field before submitting.");

}if (this.getField("Terms").value=="Yes") {
this.mailDoc({bUI:true, cTo: cToAddr, cCc: cCCAddr,
cSubject: cSubLine, cMsg: cBody});
}
else {app.alert("You must agree to the Terms by ticking the check box before sending this form.");}
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
Sorry if it wasn't clear what you were supposed to do. Try the following:

  1. if (getField("Customer Signature").value) {
  2.  
  3. // Go ahead with the submit
  4. if (this.getField("Terms").value == "Yes") {
  5. this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});
  6. } else {
  7. app.alert("You must agree to the Terms by ticking the check box before sending this form.");
  8. }
  9.  
  10. } else {
  11.  
  12. app.alert("Please sign the digital signature field before submitting.");
  13.  
  14. }
rwilki
Registered: Oct 16 2009
Posts: 37
George, you are amazing! Thank you so much. That's exactly what I was looking for.

Thanks so much!