Javascript Drop Down Email Links

by "Jeremy Pratte" <artman(at)clearpages.com>

 Date:  Fri, 22 Sep 2000 00:49:39 -0500
 To:  <hwg-techniques(at)mail.hwg.org>
 References: 
  todo: View Thread, Original
I hope one of you guys can help me with this:
At my web design firm, often we like to use javascript in conjunction with a
drop down menu as a nice way to organize a long list of links.  We do this
fairly often and never have any problems except when we want there to be
mailto: email links.  For some reason, with this particular script, if you
try to reference an email link, you get an error.
My question is, can anybody who knows this script (there'll be a sample
below) tell me how to modify it so email links work, or if you know a
completely different script that would help.

Here is some sample code:

(this is the code inbetween the header tags)
<script LANGUAGE="JavaScript">

function leapto(form) {
var myindex=form.dest.selectedIndex
parent.location.href=(form.dest.options[myindex].value);
}
// -->
</script>

and this is the form/javascript code in the actual HTML page:

<select NAME="dest" SIZE="1" onChange="leapto(this.form)" style="font-size:
10pt">
              <option selected value="Select Your Zip Code">Select Your St.
              Louis Zip Code</option>
              <option
value="mailto:tshambarger(at)municipaltool.com">63005</option>
                <option
value="mailto:tshambarger(at)municipaltool.com">63011</option>
              </select>

Now this code works if it's just an .htm or .html link, as in <option
value="page">Page</option> but not with mailto links.
So can anybody help?

Jeremy Pratte
artman(at)clearpages.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.