Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Email Submit button linked to drop down box.

Avatar

Former Community Member
Hello.



I have a form that needs to go to multiple people depending on what ministry they work for. I have created a drop down box that has the ministry list. Is there a way, to either create a button on the fly, or to create an if/else statement to format the submit button or any other type of button, check box, etc. So that when the user selects the ministry that button is formatted with the correct email address???



The other part of my question is can you change the name of the PDF file that is being submitted, right now mine just submits as a randomly generated file name? Can I have all the PDF's be emailed as PDF123.PDF, or something??



HELP...

Thanks.

Mike
2 Replies

Avatar

Former Community Member
Have you or anyone else figured out how to do this?

Avatar

Former Community Member
It might be possible.



1. Set your drop down list Ministry names to the email values that you need in the Binding tab.



2. In the button that you create as the submit create a JavaScript that executes something like the following:



//BEGIN CODE

//Note the path of the field will be different.



var oMinistry = (F.P1.Ministry.rawValue);

var oBody = "The email body"



event.target.submitForm({cURL:"mailto: "+oMinistry+"?subject=Case Submission"+"&body="+oBody, cSubmitAs:"PDF", cCharset:"utf-8" });

//END CODE



Rocky