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

Exit and go back into a form without losing data

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a form and when the user fills in it, he can go to another page (via a link) to give other information. When the other information are given and that he wants to go back to the form, all the values that had been completed till the link are no longer filled in. How can I do to have them as before? (avoiding Javascript as I don't know about)
Bye
 
If you save them in your second form in hidden form fields than you can simply repopulate the form:
Code:
page1.asp
<html>
<body>
<form method=POST action=&quot;page2.asp&quot;
<input type=&quot;text&quot; name=&quot;username&quot; value=&quot;<%=Request.Form(&quot;username&quot;)%>&quot;>
<input type=&quot;text&quot; name=&quot;entry2&quot; value=&quot;<%=Request.Form(&quot;entry2&quot;)%>&quot;>
<input type=&quot;text&quot; name=&quot;entry3&quot; value=&quot;<%=Request.Form(&quot;entry3&quot;)%>&quot;>
<input type=&quot;submit&quot;>
</form>
</body>
</html>

Page2.asp
<html>
<body>
Please enter this additional information before continuing:
<form method=POST action=&quot;page1.asp&quot;>
<input type=&quot;text&quot; name=&quot;moreinfo1&quot;>
<input type=&quot;text&quot; name=&quot;moreinfo2&quot;>
<input type=&quot;text&quot; name=&quot;moreinfo3&quot;>
<input type=&quot;hidden&quot; name=&quot;username&quot; value=&quot;<%=Request.Form(&quot;username&quot;)%>&quot;>
<input type=&quot;hidden&quot; name=&quot;entry2&quot; value=&quot;<%=Request.Form(&quot;entry2&quot;)%>&quot;>
<input type=&quot;hidden&quot; name=&quot;entry3&quot; value=&quot;<%=Request.Form(&quot;entry3&quot;)%>&quot;>

Obviously this is just a very small example, but the concept will be the same in your case. What you will want to do is store the data from the first page in like named hidden fields in your second page. If you have the
Code:
<%=Reque...%>
's in your first page the initial value will be blank, as they have not started to fill it out yet. When they submit to add additional data the original data is plave in hidden fields so that when you go to page 3 you can simply re-use the form from page 1 to display the already completed data.
As I said above, this is not exctly what you are looking for, only similar. I would need to know more about the way your pages are being called and data being stored to give a more specific example.
Hope it helped,
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
try using cookies to store the information.. once the form is filled out and submitted, expire the cookie so that information will not come back up if someone else uses that machine to register.

Cheers,

G.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top