Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Unlinking e-mail submit buttons?

maestrodog1
Level 4
Level 4

Hi all.  Trying to create e-mail submission buttons, and I've got it nearly correct except for one error in the scripting commands that I can't find.  For some reason, clicking either e-mail button opens two messages (one for the upper section and another for the lower section) instead of opening just a single message for the text field I'm trying to reference the button to.

The link to the document is here:

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

I'm using Acrobat 9.3, LS 8.2, and the e-mail client is MS Outlook 2007 on WinXP.

Anyone know where the fix is?  Thanks!

1 Accepted Solution
pguerett
Correct answer by
Level 10
Level 10

You put the code on the preSubmit event. That event will fire on all objects when a submit happens. Move your code to the Enter event (for both buttons) and only the code associated with that button will fire when you click on the button.

Paul

View solution in original post

5 Replies
pguerett
Correct answer by
Level 10
Level 10

You put the code on the preSubmit event. That event will fire on all objects when a submit happens. Move your code to the Enter event (for both buttons) and only the code associated with that button will fire when you click on the button.

Paul

View solution in original post

maestrodog1
Level 4
Level 4

Hi Paul.  This is kind of nitpicky, but although your solution worked fine in fixing the e-mail event firing, my recipients are apparently getting a "Submit canceled" message when they click the e-mail button to submit, even though the functionality works in all other respects (the e-mail sends properly to the proper persons).  Any idea what's wrong?  I updated the file with your fixes and the code in the proper place:

https://acrobat.com/#d=40jQ4MZutn-BPLswgv37PA

pguerett
Level 10
Level 10

I am getting the same behaviour. I think it is happening because you have code on that submit button (usually you do not write code on a submit button). If I add a second button (a regular button) and put the code on the click event of that button then add a command to click the email submit button then it works fine. Of course you woudl hide the real submit button (change the presence to hidden) and make the other button look like the submit. I left them as they are so you can see what is happening.

See my attached sample.

Paul

maestrodog1
Level 4
Level 4

This is definitely workable, Srini left me a slightly more efficient solution in another post.  But you taught me a couple of new tricks that I believe will be useful on future forms.  Thanks much!