Hi Simon,
It doesnt seem to be recognizing the hidden variables? When the form
resubmits itself, the hidden variables are blank.
Here's the code:
<form name="queryform " method='post'>
<%
' ADO constants used in this page
Const adOpenForwardOn ly = 0
Const adLockReadOnly = 1
Const adCmdTableDirec t = &H0200
Const adUseClient = 3
If Len(Request("pa genum")) = 0 Then
lqrystatus = request.form("D ropDownStatus") 'incomplete
lqrygrp = request.form("D ropDownSort")
lstartdate = request.form("s tartdate")
lenddate = request.form("e nddate")
lplocation = request.form("D ropDownLocation ")
lqryemp = request.form("D ropDownGroup")
'response.write (startdate & ", " & enddate & "," & qrygrp)
Else
lqrystatus = request.form("q rystatus") 'incomplete
lqrygrp = request.form("q rygrp")
lstartdate = request.form("s tartdate")
lenddate = request.form("e nddate")
lplocation = request.form("p location")
lqryemp = request.form("q ryemp")
'response.write (startdate & ", " & enddate & "," & qrygrp)
end if
response.write ("<input type='hidden' name='qrystatus ' value='" & lqrystatus
& "'>")
response.write ("<input type='hidden' name='qrygrp' value='" & lqrygrp &
"'>")
response.write ("<input type='hidden' name='startdate ' value='" & lstartdate
& "'>")
response.write ("<input type='hidden' name='enddate' value='" & lenddate &
"'>")
response.write ("<input type='hidden' name='plocation ' value='" & lplocation
& "'>")
response.write ("<input type='hidden' name='qryemp' value='" & lqryemp &
"'>")
response.write Len(Request("pa genum") & chr(13))
response.write ("hello " & lqryemp & chr(13))
sql and query building in here.....
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=1"">F irst Page</a>"
Response.Write " |&nb sp;"
If abspage = 1 Then
Response.Write "<span style=""color:s ilver;"">Previo us Page</span>"
Else
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & abspage - 1 & """>Previou s Page</a>"
End If
Response.Write " |&nb sp;"
If abspage < pagecnt Then
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & abspage + 1 & """>Next Page</a>"
Else
Response.Write "<span style=""color:s ilver;"">Next Page</span>"
End If
Response.Write " |&nb sp;"
if abspage = pagecnt then
Response.Write "<span style=""color:s ilver;"">Next Page</span>"
Else
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & pagecnt & """>Last Page</a>"
end if
Response.Write "</div>" & vbcrlf
thanks,
Will
"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:gu_ob.2541 59$9l5.111344@p d7tw2no...
"wk6pack" <wk***@sd61.bc. ca> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. .. Hi,
I have an asp page that I would like to do paging. The problem I'm running into is that the same page that prints to the output is also recieving
data from the previous page for query parameters for the sql string.
When I click on the next page, it queries itself and loses all the query
parameter information from the parameter page and brings back all the
records.
How can I keep the parameter values from the query form and still
advance to the next page?
thanks,
Will
In the "next" page, include all the form fields sent to it in the new form
using "hidden" as the field type. They won't show up on the "next" page
but will be added to it's form values. e.g.
Page 1 :
<form....>
<input type="text" name="Page1Fiel d1">
</form>
Page 1 on submit sends it's info to Page 2
Page 2 :
<form....>
<input type="hidden" name="Page1Fiel d1">
<input type="text" name="Page2Fiel d1">
</form>
Page 2 calls page 3
Page 3 :
response.write( request.form(Pa ge1Field1))
response.write( request.form(Pa ge2Field1))
Got it?
Good luck. I spent ages and ages getting all this stuff down pat about
passing form information around.