Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Change email address for submit based on radio button

Avatar

Former Community Member
I have a form with a radio button at the top of Page1 to determine if the form is for a parts order or a pump order. Based off this value I would like to change the form to email to a different email address (parts@x.com or pumps@x.com).



I cant seem to find a way to make this work. Also, the email submit button is on the "Master Page" used as the framework for all the pages, I dont know if that poses any problems.



Any help would be greatly appreciated :-)
2 Replies

Avatar

Former Community Member
One way to do it would be to have a script that runs when the selected radio button changes, that changes the email submit button's target.



The code to change the target looks like this:



EmailSubmitButton1.resolveNode("#event.submit").setAttribute("mailto:parts@x.com?subject=Parts Request", "target");



Hope this helps!

--

SteveX

Adobe Systems

Avatar

Former Community Member
I cant seem to get this to work right for some reason ... my code for the change event looks like this ... any ideas what I am doing wrong?



Thanks,



~Matt



----- EPO_OE_DOM.Page1.pumpORparts::change - (JavaScript, client) ----------------------------------



if (this.rawValue == 0) {

EmailSubmitButton1.resolveNode("#event.submit").setAttribute("mailto:pumps@x.com?subject=Pumps Form", "target");

} else {

EmailSubmitButton1.resolveNode("#event.submit").setAttribute("mailto:parts@x.com?subject=Parts Form", "target");

}



I also tried using EPO_OE_DOM.MasterPages.Page1.EmailSubmitButton1.EmailSubmitButton1.... but didnt have any luck with that either.