Form results e-mailed to selected recipient

J

Jeff

Does anyone know how to create a dropdown list of e-mail addresses that the
user can select, and have the form results e-mailed only to the selected user
(or users)?

I would like to have users of an internal Intranet page to be able to select
specific distibution lists (e-mail addresses) from a dropdown list to send
out specific company alerts.

Thanks,

Jeff
 
T

Trevor L.

Jeff said:
Does anyone know how to create a dropdown list of e-mail addresses
that the user can select, and have the form results e-mailed only to
the selected user (or users)?

I would like to have users of an internal Intranet page to be able to
select specific distibution lists (e-mail addresses) from a dropdown
list to send out specific company alerts.

Hmmm.
Yes, I am sure it can be done with some JS and provided you use the form to
email method that uses the browsers's default email client.

I could have a try (just to satisfy myself and to post if it works) but it
is late (-ish) in the (Australian) day now, so if I see no replies tomorrow,
I might give it a go then.
 
T

Trevor L.

Trevor said:
Hmmm.
Yes, I am sure it can be done with some JS and provided you use the
form to email method that uses the browsers's default email client.

I could have a try (just to satisfy myself and to post if it works)
but it is late (-ish) in the (Australian) day now, so if I see no
replies tomorrow, I might give it a go then.

OK a bit later than I thought but here is some code that does it. It will
only send to one address. If you want more than one, that needs a bit of
tweaking.

In function mailto():
Alter variable subj.
Set variable text to your needs. I have set it to extract field1 and field2
with a line break between each

In form1:
Alter email1@com, email2@com, etc to valid email addresses

<html>
<head>
<script type="text/javascript">
function mailto(person)
{
var subj ="Subject"
var text = form1.field1.value + "%0d%0a"
+ form1.field2.value
window.location = "mailto:" + person
+ "?subject=" + subj
+ "&body=" + text
}
</script>
</head>
<body>
<form id="form1" action="">
Field 1<input type="text" id="field1" value="" size="40" /><br/>
Field 2<input type="text" id="field2" value="" size="40" /><br/>

Email to: <br />
<select onchange="if(options[selectedIndex].value)
mailto(options[selectedIndex].value)">
<option>--Select one---</option>
<option value="email1@com"> email1@com</option>
<option value="email2@com"> email2@com</option>
<option value="email3@com"> email3@com</option>
</select>
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top