Re: Javascript Drop Down Email Links
by "Kim Coleman" <kim(at)ktsplace.com>
|
Date: |
Thu, 21 Sep 2000 23:32:53 -0400 |
To: |
"Jeremy Pratte" <artman(at)clearpages.com>, <hwg-techniques(at)mail.hwg.org> |
References: |
Clearpages |
|
todo: View
Thread,
Original
|
|
Jeremy-
I frequently use the dropdown menu approach myself and have a good and
simple script that works well with mailto links
check out the following links for examples
http://avalonadventure.net/index2.shtml - the Avalon Staff menu shows the
mailto: link (most of the other links aren't working as the site is still
under construction)
http://cofguild.com/index2.shtml - no mailto: links but another completely
working example of the dropdown script. It just uses the normal "mailto: "
links
Any questions,let me know
Kim
----- Original Message -----
From: "Jeremy Pratte" <artman(at)clearpages.com>
To: <hwg-techniques(at)mail.hwg.org>
Sent: Friday, September 22, 2000 1:49 AM
Subject: Javascript Drop Down Email Links
> 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