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

Conditional submit button

markandrew21
Registered: Jun 10 2008
Posts: 2

I have a simple form. with 2 textboxs a checkbox and a submit button.

textbox #1 is for a message
textbox#2 is for your email address
checkbox # is to send a copy to yourself
submit button sends a copy to joeblow [at] xyzcorp [dot] com

Does anyone know how to get this form to send a copy of the completed PDF to both yourself and joeblow if the checkbox is checked and the user clicks on the submit button.

Thanks,

Mark

My Product Information:
Acrobat Pro 8.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Use the JavaScript either the "doc.submitForm()" or "doc.mailForm()" fucntion to submit the form. Email addresses are a semi-colon separated list.

var cAdr = "<span class="spamspan"><span class="u">joeblow</span> [at] <span class="d">xyzcorp [dot] com</span></span>";var cMessage = this.getField("textbox1").value;if(this.getField("checkbox").isBoxChecked(0)){cAdr += ";" + this.getField("textbox2").value;}this.mailForm({cTo:cAdr,cSubject:"Submit",cMsg:cMessage});

Here's an article on using the "submitForm()" function,
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/submitting_data/

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script