Re: Javascript Drop Down Email Links
by "Norman Bunn" <norman.bunn(at)craftedsolutions.com>
|
| Date: |
Thu, 21 Sep 2000 15:47:30 -0400 |
| To: |
"Jeremy Pratte" <artman(at)clearpages.com>, <hwg-techniques(at)mail.hwg.org> |
| References: |
Clearpages |
| |
todo: View
Thread,
Original
|
|
Just a guess, but could it be that "@" is a reserved character in JS? Try
putting a "\" in front
of it to make it a literal "@" and see what happens. This one gets me in
perl all the time! :)
Norman
----- 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
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.