RE: form and links in selects
by Chuck Evans <Chucke(at)captura.com>
|
| Date: |
Fri, 2 Feb 2001 10:20:37 -0800 |
| To: |
"'chip.wiegand(at)simrad.com'" <chip.wiegand(at)simrad.com>, hwg-techniques(at)hwg.org |
| |
todo: View
Thread,
Original
|
|
To get a dropdown list to work without javascript (or some other browser
scripting language) you have to use server-side processing. That means using
Perl, ASP, PHP, or whatever you like best. When the user chooses a dropdown
item, they'll have to click a Submit button (labelled "Go" or whatever) and
then the value in the option list is passed to the server-side script for
action.
Let's say you have the actual link a form called "navigate", in an option
tag named "link", and with a value of "/products/index.html". A simple ASP
script on the server could be:
<%
whereyouwanttogo = Request("link")
Response.redirect whereyouwanttogo
%>
That's off the top of my head, so I might have it a bit wrong, but I think
you get the idea. Using Perl it would be similar, but with different
commands.
Chuck Evans
Captura, Inc.
(425) 803-6455
http://www.captura.com
-----Original Message-----
From: chip.wiegand(at)simrad.com [mailto:chip.wiegand(at)simrad.com]
I tried to use a <a href> tag inside a <select><option> but it doesn't work.
I
tried
with the following formats (shortened a bit to save space):
<select><option><a href>link</a></option>
<select><a href><option>link</option></a>
<select><option onClick='a href>link</option>
and I've tried with and without a submit button on all three versions.
None work. Is the only way to do this with javascript? That seems overly
complicated
for such a simple menu. I checked the w3c web site and docs and don't see
any
reference to this.
I'm just looking for an alternative to the javascript drop-down menu that
won't
work
without javascript enabled, of course. This is an assignment for a class
where
the teach
is using javascript for the menu, I thought it would be easier to do in
html.
Maybe not?
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.