Click to See Complete Forum and Search --> : Submit to different emails via submit


matilda
04-08-2003, 06:58 AM
Hi,

Does anyone know how I can get a form to email to different email addresses depending on what choice is made in a previous dropdown box

I want the form to submit to whichever option the user selects - i.e. mail to the person chosen from the dropdown

e.g. I have a form that contains a dropdown with 5 different people, depending on whom i opt for - onsubmit will send to one of 5 people...
E.g. John - if the user select a option John and clicks submit the form knows to mail it to john@somewhere.com
If the user selects a option Jack and clicks submit the form knows to mail it to jack@somewhere.com
If the user selects a option Jill and clicks submit the form knows to mail it to Jill@somewhere.com

I hope this makes sense, any help is very much appreciated
Thanks!

gil davis
04-08-2003, 07:38 AM
<script>
function setAddr(fm) {
action = "mailto:" + fm.s1.options[fm.s1.selectedIndex].value;
fm.action = action;
alert(fm.action);
fm.submit();
}
</script>
<form action="mailto:" onsubmit="setAddr(this)">
<select name="s1">
<option value="one@abc.com">One
<option value="two@abc.com">Two
<option value="three@abc.com">Three
<option value="four@abc.com">Four
<option value="five@abc.com">Five
</select>
<input type="submit">
</form>

matilda
04-08-2003, 08:39 AM
Hi Gil,

Thanks for this - this is what I am after... However I am having a few difficulties getting it to work in my form

I have created the form via frontpage and frontpage creates the following at the beginning of the form - so my form will go to this address, I have tried removing htis default address but still no joy - is there anything I shoudl be putting in there?

<!--webbot bot="SaveResults" startspan
U-File="../_private/ReleaseTaperequests.html" S-Format="HTML/BR"
S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="HTML/PRE"
S-Email-Address="pctester@ranplc.co.uk" B-Email-Label-Fields="TRUE"
B-Email-Subject-From-Field="FALSE" S-Email-Subject="Release Tape Request Form"
S-Builtin-Fields U-Confirmation-Url="thanks.htm" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot
bot="SaveResults" endspan -->

gil davis
04-08-2003, 08:53 AM
I have no idea. I'm not familiar with that structure.