submittimg parameters with jump menus and list objects

overview
appending parameters to a jump menu

using a list to submit a form
using a jump menu to submit a form

overview

this page shows 3 different ways in which you might want to submit parameters using a "list" form object.

since the main objective is to show how to create the menus, not how to evaluate the parameters, all forms redirect to this page and append the parameters to the URL (GET method). to see if the parameters were submitted correctly just check the URL of this page in the location field of your browser.

back to top

 

appending parameters to a jump menu

this is quite straight forward. just create the jumpmenu as usual (could be static, could be dynamic) but when you enter the URLs you add parameters to it. like: listsubm.htm?jump=1

 

 


(all options link back to this page).  

 

back to top


using a list to submit a form

this is not very difficult either - you create your form as usual but instead inserting a submit button you type

onChange="submit()"

into the <select> tag. you can do the same with other form objects.

<form method="get" action="listsubm.htm" name="form1">
<select name="select" onChange="submit()">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
</form>

 

 

enter some text here:

select an option to submit the form:

(all options link back to this page).


back to top

 

using a jump menu to submit a form

lets say you have a few selection criteria that you want to pass on but the user should be able to chose between different locations to go to next.

probably the easiest way is not to use a jump menu that works with clientside JavaScript but with a simple form submission (GET method) as shown above and to use ASP to do the redirection.

 

 

select an option here:

check this box if you want:

enter some text here:

select an option to submit the form:

a     b

(all options link back to this page but target different anchors. this is first of all a test for submitting URLs. not all browsers will necessarily scroll down to the anchors)

 

this form uses an ASP page with the following code. you can use as many form elements as you like but the one that holds the URL for redirection has to be called "newlocation".

(if you want you can use this script for any redirection of a form that has a field "newlocation", e.g. you could have a text field into which the user can enter an URL of choice).

<%@LANGUAGE="VBSCRIPT"%>
<%
dim bgx_newpage,bgx_newstring,bgx_list
bgx_list = ""

' list all items from the Querystring exept "newlocation"
t1 = split(request.Querystring, "&")
for each x in t1
t2 = split(x, "=")
if (Not t2(0) = "newlocation") then
bgx_list = bgx_list & x & "&"
end if
next

' get rid of last "&"
bgx_newstring = Left(bgx_list, Len(bgx_list) -1)
' finalise the new URL
bgx_newpage = Request("newlocation") & "?" & bgx_newstring

' redirect
Response.Redirect(bgx_newpage)

' bg, 5/8/2002
%>

click here to download the page.

back to top
 

 

1