Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass variable next page

Status
Not open for further replies.

carranz

Technical User
Nov 17, 2006
40
US
I have a submit button that takes me to the next page
I would like to pass this value to the next page.

<%
dim st
st = Recordset1.Fields.Item(\"dept\").Value
%>

here is my submit button code
<input type=\"submit\" name=\"Submit\" value=\"Login \">

any help would be appriciated
 
Since you have a submit button I will assume you have an HTML <form>

... and with that assumption I suggestion using a "hidden form element" as follows:
[tt]
<input type="hidden" name="dept" value="[highlight]<%= Recordset1("dept")%>[/highlight]">
[/tt]
 
another way...use session variable:

dim st
st = Recordset1.Fields.Item(\"dept\").Value
Session("myst")= st

then you can use Session("myst") on the next page...

-DNG
 
Sheco

Is this how I would get the value on the next page?
or is there a different way
request.QueryString(\"dept\")
 
if you use the form submission method as "POST" then you need to say request.form("dept") on the next page...

if you use the form submission method as "GET" then you need to say request.querystring("dept")

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top