Expand my Community achievements bar.

SOLVED

Dynamically change send-to address of EmailSubmitButton

Avatar

Level 2

I'm modifying an access request form that we use. Depending on whether the request is for new access (for a new user) or a change to existing access, there may be more than one person who needs to receive the form. I need to know how to modify the EmailAddress property of the EmailSubmitButton in response to a selection from a RadioButton list. I'm not having much luck finding an object model or other resource I can use to examine and change the appropriate properties in JavaScript.

I'm hoping this is something that's been done alot and has some basic scripts already set up.

1 Accepted Solution

Avatar

Correct answer by
Level 10

That was because the CC Email address was not entered.. If you enter CC Email address the email should open for you..

In any case, I modified the file to check for CC Email address and it is available here.

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

Thanks

Srini

View solution in original post

6 Replies

Avatar

Level 10

Here is a sample that can help you.

https://acrobat.com/#d=EQ2vEexbmzl92x4N*wkcFw

In this file I am taking the To/ CC Email address, Subject and Message from the inputs from the user. If you have radio buttons in your form, you can get the value of the radio button to pass in Email Address.

Thanks

Srini

Avatar

Level 2

Are there similar examples for using a RadioButton selection in an if-then statement? Or better, do you have a link to a library of examples?

Avatar

Level 10

Below is a modified version of the same with Radio buttons.. Hope this helps.

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

For Radiobuttons, you do not need if else statements because, the user can choose only one option from the radio buttons.

Thanks

Srini

Avatar

Level 2

When I run the script, I get an error message from Outlook.

A "Check Names" popup opens, and it show the message: Microsoft Office Outlook found more than one "null".

Avatar

Correct answer by
Level 10

That was because the CC Email address was not entered.. If you enter CC Email address the email should open for you..

In any case, I modified the file to check for CC Email address and it is available here.

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

Thanks

Srini

Avatar

Level 2

Srini,

Thanks! That works!

Out of curiosity, is there a way to control the filename of the PDF that gets created? The attachment to the email is named like a hash code.