Highlighted

E-mail sumbit button based on drop down choice

Avatar

Guest

27-03-2009

I would like my button to submit to my for to an e-mail address depending on which name is selected from a drop down menu (the drop down menu name: CSR). There are 5 possible names in the drop down menu (BA, KC, GH, NR and MR).



I know how to create an e-mail submit button on it's own, but just can't figure out how to have it select the e-mail address based on the drop down choice. Any suggestions?



Thanks!

Replies

Highlighted

DonKeating

28-03-2009

Sharon



I'm new to the Designer so, unable to answer your question.



But, hopefully you or someone will answer mine.



How can I designate (assign) name to the XML file that gets sent?



Thanks.




Highlighted

_SekharN_

30-03-2009

Instead of standard Email button I would choose a regular button and will have following JS code added in Click event.........



var eadd = "";

var subj = "Subject text";

var ebody = "Email Body text goes here";



if (dd.rawValue == "BA") {

eadd = "BA@Company.com";

}

if (dd.rawValue == "KC") {

eadd = "KC@Company.com";

}

if (dd.rawValue == "GH") {

eadd = "GH@Company.com";

}



event.target.submitForm({cURL:"mailto:"+eadd+"?subject="+subj+"&body="+ebody,cSubmitAs:"XML",cCharset:"utf-8"});



//Replace XML with PDF if you wish to attach PDF document rather than XML

//this is just an example for you to start working on you may still have to work on other validations
Highlighted

Avatar

Guest

30-03-2009

Thanks so much for the great start. I never would have figured that out without your help.



I've followed your path and integrated my own information with the code above. However, when I click on the button, nothing happens. I can click (no error messages), but no action follows. Any ideas?
Highlighted

_SekharN_

30-03-2009

JavaScript is picky and case sensitive. I suspect some silly mistakes. Those have to be resolved and are part of learning curve. If you want me take a look just shoot me an email at "meetsekharv AT yahoo.com" with your template attached.