Skip to main content
November 17, 2016
Question

Acrobat PDF Form Javascript question

  • November 17, 2016
  • 1 reply
  • 383 views

Hello!

I have a form that runs a JavaScript on Submit. It pulls a cc address in from a text field (that is populated by a dropdown selection JavaScript) and submits the form to certain email addresses - this part runs perfectly.

I have been asked to update the form to incorporate 4 check boxes and if any of these are selected - the form should be submitted to an additional cc email address.

If none are selected then the form runs as it currently is.

This may be too general for assistance but I am willing to provide more information if it is helpful.

Thank you SO much for sharing your knowledge!

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
November 17, 2016

That should be pretty easy to do. We'd need to see the JavaScript that runs when the form i submitted and understand more about the new checkbox names and values. Depending on how you add the modifications, you can make this easier or harder on yourself. It'd help to see the form.

November 17, 2016

var cToAddr = "XXXXX@XXXX.com; XXXXX@XXXXX.com"

var cCcAddr = this.getField("Text1").value;

var cSofAddr = this.getField("Text2").value;
if(cSofAddr != "")
cCCAddr += ";" + cSofAddr;

var cSubLine = "New Hire Form " + this.getField("MemberName").value;

this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCcAddr, cSubject: cSubLine});

The above is what is on the Submit Mouse Up action. The SofAddr is a hidden text field that I attempted to populate based on if the checkboxes were active...it didn't work.