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

Unlinking e-mail submit buttons?

Avatar

Former Community Member

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

Avatar

Correct answer by
Former Community Member

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

Avatar

Correct answer by
Former Community Member

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

Avatar

Former Community Member

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

Avatar

Former Community Member

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

Avatar

Former Community Member

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!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----