/    Sign up×
Community /Pin to ProfileBookmark

Submit to different emails via submit

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 [email][email protected][/email]
If the user selects a option Jack and clicks submit the form knows to mail it to [email][email protected][/email]
If the user selects a option Jill and clicks submit the form knows to mail it to [email][email protected][/email]

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

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 08.2003 — <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="[email protected]">One
<option value="[email protected]">Two
<option value="[email protected]">Three
<option value="[email protected]">Four
<option value="[email protected]">Five
</select>
<input type="submit">
</form>
Copy linkTweet thisAlerts:
@matildaauthorApr 08.2003 — 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="[email protected]" 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 -->
Copy linkTweet thisAlerts:
@gil_davisApr 08.2003 — I have no idea. I'm not familiar with that structure.
×

Success!

Help @matilda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...