By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,586 Members | 623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,586 IT Pros & Developers. It's quick & easy.

Automatically go to URL After choosing Menu Item

P: n/a
Is there a way to automatically load a page, after the user selects a
menu item from a form?
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
bb****@myrealbox.com (Bunny) wrote:
Is there a way to automatically load a page, after the user selects a
menu item from a form?


Partly, but certainly not in HTML, and you shouldn't base navigation on
such ideas. For detailed info, see
http://www.cs.tut.fi/~jkorpela/forms/navmenu.html

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
bb****@myrealbox.com (Bunny) wrote:
The menu items are not URLs; they are data to be passed to the loaded
page, which is always the same regardles of which item was selected.


So what are you trying to accomplish? HTML has no data processing
capabilities, so there must be something else implied in the question, and
probably something that makes the question off-topic here.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3

P: n/a
In article <a8**************************@posting.google.com > in
comp.infosystems.www.authoring.html, Bunny <bb****@myrealbox.com>
wrote:
Is there a way to automatically load a page, after the user selects a
menu item from a form?


Yes, with JavaScript. It will please some of your visitors, annoy
some, and not work for still others.

Generally it is bad usability to make a page transition unless the
user has taken a recognized action to trigger it, typically on the
WWW by selecting a button or a link.

So instead of a menu, why not have a set of buttons or links that do
what you want? (The buttons could be one-element forms.) One
additional benefit of these approaches is that the user can easily
see all choices at once, which may menu controls make impossible.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #4

P: n/a
bb****@myrealbox.com (Bunny) wrote in message news:<a8**************************@posting.google. com>...
Is there a way to automatically load a page, after the user selects a
menu item from a form?


The purists will tell you not to do this at all, but here's my
preferred method:

<form name="TheForm" method="post" action="/jump.asp">
Pick a part number:
<select name="GoHere" onChange="submit()">
<!-- ^^^^^^^^^^^^^^^^^^^this is the key part-->
<option value="so8">SO8</option>
<option value="so8rf">SO8RF</option>
..
..
..
<option value="qfp-48">QFP-48-0.5</option>
<option value="qfp-52">QFP-52-0.65</option>
<option value="qfp-64">QFP-64-0.5</option>
</select>
<input type="submit" value="Go">
</form>

Of course you need to have code at /jump.asp to make it work, but the
nice thing about this method is that it degrades gracefully--if the
client has .js disabled, they can still submit the form and get
directed the page they want.

I've seen many pages that use a client-side javascript to do this,
where the author omits the Submit button and has no server-side script
to handle .js-disabled clients. Therefore .js-disabled clients are
completely SOL.

So the above method basically implements a solution assuming that .js
is unavailable, and then puts in a tiny little trigger to make it
submit automatically if .js is enabled.

p.s. completely OT for this group, but since you're asking, the
/jump.asp code looks like this:

<%@ Language = "VBScript" %>

<%

Select Case request.form ("GoHere")
Case "so8"
Response.redirect("/products/so8ecl.htm")
Case "so8rf"
Response.redirect("/products/SO8RF_footprints.htm")
Case "so14"
Response.redirect("/products/SO14RF_footprints.htm")
..
..
..
Case "qfp-48"
Response.redirect("/products/qfp48.htm")
Case "qfp-52"
Response.redirect("/products/qfp52.htm")
Case "qfp-64"
Response.redirect("/products/qfp64.htm")
End Select

%>
Jul 20 '05 #5

P: n/a
Bunny wrote:
Is there a way to automatically load a page, after the user selects a
menu item from a form?


There is no way to do this using only HTML.

--
Shawn K. Quinn
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.