Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down boxes - mail to 1

Status
Not open for further replies.

redmike

Technical User
Feb 25, 2002
46
0
0
IL

Hi,

I'd like to place a drop down box on a website with several 'mail me' names
sales
webmaster
complaints :)
etc

I found this script which seems quite nice ..
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<!-- Add this to the <head> section -->
<script language="JavaScript" type="text/javascript">
function GotoURL() {
location.href=document.go.picker[document.go.picker.selectedIndex].value;}</script>
<!-- Add this to the <body> section -->
<!-- Obviously, you should edit the code to show your own URLs, and you can change the style attributes to suit your colour scheme -->
<form name="go" id="go">
<select name="picker" id="picker" style="font-family: Arial, Helvetica, sans-serif;">
<option value="index3.htm" style="background-color: #e0e0e0;" selected>Home Page</option>
<option value="contents.htm">Contents</option>
<option value="feedback.htm" style="background-color: #e0e0e0;">Webmaster</option>
<option value="tools.htm">Tools I use</option>
</select>
<input type="button" value="Go" style="color:#FFFFFF;background:#CC9900" title="Click to Go" onClick="GotoURL()">
</form>
</body>
</html>

but how can I add something similar to ...
<a href="mailto:rupert.wilson@gmail.com">rupert.wilson@gmail.com</a>
to each value ?

many thanks

Michael
 
I edited you script a bit I hope this helps.
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<!-- Add this to the <head> section -->
<script language="JavaScript" type="text/javascript">
function GotoURL() {
location.href="mailto:" + document.getElementsByName("picker")[0].value;

}
</script>
<!-- Add this to the <body> section -->
<!-- Obviously, you should edit the code to show your own URLs, and you can change the style attributes to suit your colour scheme -->
<form name="go" id="go">
<select name="picker" id="picker" style="font-family: Arial, Helvetica, sans-serif;">
<option value="hi@hi.com" style="background-color: #e0e0e0;" selected>Home Page</option>
<option value="hello@hello.com">Contents</option>
<option value="goodbye@goodbye.com" style="background-color: #e0e0e0;">Webmaster</option>
<option value="lol@lol.com">Tools I use</option>
</select>
<input type="button" value="Go" style="color:#FFFFFF;background:#CC9900" title="Click to Go" onClick="GotoURL()">
</form>
</body>
</html>

I don't know the answer but my good friend Google does.
 
thanks very much - exactly what I wanted :)

and you did all the work !

regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top