Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Submit pdf form to Emails written in textboxes

Avatar

Level 3

I have 4 textboxes in my form. All textboxes are for the user to input email addresses.

I'd like for the form to submit to the emails written in these textboxes.

Can anyone help with a script for that?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Sorry, I can't do at the moment.

I am prepping for work and will be out of the office until Friday.

The solution is quite straightforward. Just copy the date/time field and

copy the script to the first part of the click event of the submit button.

Good luck,

Niall

View solution in original post

16 Replies

Avatar

Level 10

Hi,

You can achieve this with a regular button and script in the click event.

I have an example here: http://assure.ly/fiTm2i.

There are two examples, one for users with Acrobat/Reader v9 and above. The second example is for users with earlier versions of Acrobat/Reader.

You should have a look at the script in the third button, which is a regular button and NOT a submit by email button.

Note you should check the values of the four textfields first to make sure they are not null. Outlook does not like null email addresses.

The script deals with this and a few other issues. It should give you a directions.

Hope that helps,

Niall

Assure Dynamics

Avatar

Level 3

Hi Niall, thanks for your answer.

It works however, I have 6 textbox fields and I can't get to send to more than two emails i.e the 'mailto:' and '&cc:'

My question is:

how can I get all emails to be in the 'mailto:' field in the email?

if I can't get all emails in one 'mailto:' field, how can I create multiple CC entiries?

thanks for your help

Avatar

Level 10

Four textfields, six texfields, which is it?

The basic solution is there. If you have multiple textfields, then you can build up an email address variable. Just add a ";" and a non-null .rawValue from each textfield.

This should end up with a string that Outlook can handle in the "To" field.

N.

Avatar

Level 3

Niall,

could you please send me your email so you can see my form?

I can't seem to upload it to this discussion.

Avatar

Level 10

Hi,

You can't upload files to the forum.

If you upload your form to a file sharing site, like Acrobat.com and then post the published URL here.

Acrobat.com publish.png

I will try and get a look at it when I can.

Niall

Avatar

Level 3

Hi Niall,

somehow, I couldn't get it uploaded on Acrobat.com so I uploaded here:

http://www.4shared.com/document/beHmNU6H/Command_and_Control_v24_REVA.html

Please take a look.

I'm looking forward to your quick reply.

Thanks for all the help so far.

Avatar

Level 10

Hi,

Here is your form back to you:

https://acrobat.com/#d=OIKTdhhJsb0gnbbfD4xTIg

If you have a look at the script in the click event of the submit button, you will see how we are building up the email address string based on the six fields.

Please note that I opened this in LC Designer ES2, which only supports a target version of Acrobat/Reader 7 and above. You will need to test on your installation.

Also please note that the email submit tends not to work when previewing the form in LC Designer ES2. You will need to test in Acrobat.

Lastly, as you are looking to return the form as a PDF, users with Reader will only be able to click the Submit button if the form has been Reader Enabled.

More info on that here: http://assure.ly/gYyYc2.

Hope that helps,

Niall

Assure Dynamics

Avatar

Level 3

Thanks Niall,

I'll check and be sure to revert.

Avatar

Level 3

Hi Niall,

thanks. your answer was correct. However, the submit button didn't work properly until I removed the spaces beside the semicolon. So instead of "; " I changed it to ";" and it was perfect!

Thanks. See my form here: https://acrobat.com/#d=HVV998bcN76ak7H0blbZAw

also, I have a question on script for generating unique serial numbers for each form that is submitted. It should appear on the form when opened. How possible is this?

Please help me out.

thanks again.

Avatar

Level 10

Hi,

That's strange, it worked here!

There is an example here: https://acrobat.com/#d=7MTJmmhWCVSfQQir3XwxXQ. Basically it is a timestamp. I would recommend that the number be generated as part if the submit click event. This way it will be unlikely to get acciently updated, for example if you had it in a docReady event.

Niall

Avatar

Level 3

Niall, could you please include it into my new document so I can see the script?

thanks.

Avatar

Correct answer by
Level 10

Sorry, I can't do at the moment.

I am prepping for work and will be out of the office until Friday.

The solution is quite straightforward. Just copy the date/time field and

copy the script to the first part of the click event of the submit button.

Good luck,

Niall

Avatar

Level 3

Thanks Niall,

you're the best.

can I have your email for private contact? I'll be contacting you even more often.

Thanks again.

Avatar

Level 10

Hi,

Our contact details are at http://www.assuredynamics.com. However we can't offer free support outside of the forums.

If you contact us, we can set up a formal arrangement.

Niall

Avatar

Level 1

I was having a similiar problem, and wanted to create the same button. I have two questione

1. Where do I find the script on the form you are referencing?

2. Where do I put in on my form?

I tried to load it in LiveDesign, but when I click on the button I did not see a script.

Thank you

Avatar

Level 10

Hi,

The script is in the click event of the Script Editor. This is usually at the top of the workspace, but if this is not open you can open it by hitting F5 or from the Windows menu.

If the Script Editor is only one line tall, you can drag the bottom bar, so that you can see several lines all at once.

The button is self contained, so you can copy and paste it into your form. HOWEVER, you will need to adjust the script to reflect the names of the objects that you want to reference in the script, to the actual names of your objects.

Hope that helps,

Niall