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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using one form for 2 ASP pages

Status
Not open for further replies.

d1004

Programmer
May 9, 2002
78
US
Right now, I am using one form for the users to select the criteria. But the information in that form is used by two ASP pages. What I put on my form page is
<form action = &quot;RepLeader.asp&quot; method = &quot;post&quot;>. So when the user select the criteria, it will go to RepLeader.asp page. On that page, there is a link to Summary.asp page. Am I doing it correct because it doesn't work. Please help. Thank you!!!
 
You could put the data into hidden fields and use the post action on the second page so when they goto the 3rd page you can use request the data
 
you will either need to save the form fields in session variables or create hidden form fields in the second page with the first pages form values to send the them to a third page.
admin@onpntwebdesigns.com
 
if its not sensitive information like passwords, you could just tack them on to the end of the URL..

ie:

<a href=&quot;summary.asp?field1=text&field2=text&field3=text&quot;>CLICK HERE FOR SUMMARY</a>


Hope this has made it easier for you..

Cheers,

Gorkem.
 
In the general spirit of the above post, you could use form method=GET instead of POSt and use Request.QueryString instead of Request.Form. On your intermediary page to pass the information to you third page all you would have to do is specify the address as:
Response.Redirect &quot;page3.asp?&quot;&Request.QueryString
That should put all of the form information from the querystring directly back into the address and thus make it accessible to the third page.
-Tarwn &quot;Customer Support is an art not a service&quot; - marketing saying
&quot;So are most other forms of torture&quot; - programmers response
(The Wiz Biz - Rick Cook)
 
I can't do the Response.Redirect because I want them to be able to print the intermediate page. If they want to see the summary report, then they click the Summary Report page link. With that, I want to be able to pass the information from the form to this third page (Summary Report). I try the following code for my hyperlink, but it doesn't work.

<a href = &quot;../Summary.asp?&quot;&Request.QueryString(&quot;RepLeaderID&quot;)> Summary Report </a>

From what Gorkem mentioned above, I try the following

<a href = &quot;../Summary.asp?RepLeaderID=Request.QueryString('RepLeaderID')&quot;> Summary Report </a>

Thank you for your help!!!
 
store the items in session to keep them alive across the pages or store it a DB...

sessions might be easier if the data does not need to be stored/logged in any way. Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Actually doing it with the querystring from my porevious post your code should have been:
Code:
<a href = &quot;../Summary.asp?<%=Request.QueryString%>&quot;> Summary Report </a>
When you don't specify a field name for the querystring method it returns the entire querystring so that you don't actually have to know the contents in order to pass it into the address but still have full access to the previous information.
Working Sample:
Code:
<% Option Explicit %>
<html>
<head>
</head>
<body>
<form method=&quot;get&quot; action=&quot;sample.asp&quot;>
<input type=&quot;text&quot; name=&quot;txt1&quot;><br>
<input type=&quot;text&quot; name=&quot;txt2&quot;><br>
<input type=&quot;radio&quot; name=&quot;rad1&quot; value=&quot;a&quot;><br>
<input type=&quot;radio&quot; name=&quot;rad1&quot; value=&quot;b&quot;><br>
<input type=&quot;radio&quot; name=&quot;rad1&quot; value=&quot;c&quot;><br>
<input type=&quot;submit&quot; value=&quot;post it&quot;>
</form>
<%
Response.Write &quot;The entire querystring from the submission is: &quot; &Request.QueryString
%>
</body>
</html>

Know it's a bit late, just wanted to show I'm not entirely out of my ming :p
-Tarwn &quot;The problem with a kludge is eventually you're going to have to back and do it right.&quot; - Programmers Saying (The Wiz Biz - Rick Cook)
&quot;Your a geek!&quot; - My Girlfriends saying
 
Thank you for clarifying things for me. You guys are the best. Especially you Tarwn ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top