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
%>