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

Need "Submit Form" Button to reference Combo Box

Brianguy
Registered: Nov 10 2008
Posts: 14

Hi,

Complete newbie here updating a form in Acrobat 9.

I added a combo box drop-down containing several names (the email addresses for the names were specified in the "Export Value" field of the combo box).

I also added a "Submit Form" button next to this combo box that needs to reference the name (email address) in the combo box, then email it.

Assuming names in the combo box of:
Joe Blow (jblow [at] here [dot] com)
John Wayne (jwayne [at] here [dot] com)
Clint Eastwood (ceastwood [at] here [dot] com)

What javascript do I need to accomplish this and where do I enter it. I'm a complete newbie to it so please provide step-by-step to get my started.

Thanks in advance!!
Brian

My Product Information:
Acrobat Pro Extended 9.0, Windows
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Do you want to submit the form data or the complete PDF? What is this document used for?

George
Brianguy
Registered: Nov 10 2008
Posts: 14
Would be great if the whole pdf form would just attach to an email.

The form is for scheduling and the user selects their supervisor from the combo box, then (hopefully) clicks "Submit Form" and the form is sent to their supervisor as an email attachment .

If needed I can add another field where the user would input their own email address.

Problem is I'm not very familiar with Acrobat or the javascript, or how I would link the js to the "Submit Form" button.

Thanks!
Brian
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
I should have asked the following questions before, but the answers you give are important to how you choose implement this.

Will the users of this form be using Reader, or something more such as Acrobat Standard or Pro? Will the supervisor be using Reader or Acrobat? How many users will be using the form?

George
Brianguy
Registered: Nov 10 2008
Posts: 14
Thanks for the help George!

I'm assuming that the users will only have Acrobat Reader on their machines; same with many of the supervisors (although the supervisors can just open & print the pdf after they receive it).Potentially lots of users would access the form throughout our organization (couple hundred or more easily). All the fields are blank and user-filled except for the combo-box and the "Submit Form" button.

Thanks!!
Brian
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
OK. The JavaScript part is relatively simple, but let's set that aside for the moment. You need to make an important decision before you get too far with this.

If you want the user to be able to send the entire PDF (as opposed to just the form data) with Reader, the PDF has to be Reader-enabled. What this means is using either Acrobat Pro (8/9) or Adobe's LiveCycle Reader Extensions software ($$$$) to grant usage rights to a document. These usage rights allow Reader to do things it is not normally capable of doing, such as saving a filled-in form. Since attaching the complete PDF to an email message involves Reader saving a filled-in form, you will have to Reader-enable the form in question.

If you use Acrobat Pro 9 to Reader-enable the form, there are licensing restrictions you need to be aware of. In short, if you will be deploying the enabled form to more than 500 recipients, you can subsequently use information from no more than 500 forms that have been returned (including hardcopies). If you deploy an enabled document to fewer than 500 recipients, you can use information from an unlimited number of returned forms.

If you will not be exceeding the Acrobat licensing restrictions, then no problem. If you will, and using LiveCycle Reader Extensions isn't going to happen, there are a number of alternatives, one of which is to "submit" just the form data, which does not require a Reader-enabled form.

George
Brianguy
Registered: Nov 10 2008
Posts: 14
I currently have Acrobat 8 and am trying out 9. The number of users/recipients would be under 500 so should be no problem there.

I'll confer with some of the supervisors but I'm guessing they would prefer an attached PDF (since they're used to that) and would allow them to print if they choose.

There shouldn't be a conflict with regard to # of users & licensing requirements though.Thanks!!
Brian
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Here is a bare-bones script you can use in the Mouse Up event of a button. It gets the value of the combo box and uses the value as the recipient's email address:

// Get email address from combo boxvar recip = getField("combo1").value; // Attempt to send email with PDF as attachmenttry { mailDoc({cTo: recip,cSubject: "Your subject line text goes here.",cMsg: "Your message text goes here."}); } catch (e) { // email could not be sent for some reason, so tell userapp.alert("Email cancelled message goes here.");}

Again, this code is minimal, but you should get the idea. See the Acrobat JavaScript reference for more information on the mailDoc method. Replace "combo1" in the code above with the actual name of the combo box you're using for the email addresses. You will also need to Reader-enable the document for it to work with Reader. This should be the last thing you do before distributing it.

George
Brianguy
Registered: Nov 10 2008
Posts: 14
That works George - you're awesome!

Quick question you probably have run into:

When I click my "Submit Form" button I immediately get a error message of "Invalid File Specification Object"...

When I click OK it opens my email client and I see the attachment in place ready to send. Click send and everything goes through fine.

Any idea what causes the initial error message?

Thanks again for all the help!
Brian
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
No, I don't know what's causing that. I'd have to look at the form...

George