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!

Back to Form 1

Status
Not open for further replies.

ivow

Programmer
Aug 6, 2002
55
CA
Hi,

I've created a form and a page that validates it displaying the errors. On the validation page I put a back button that returns the user to the previous page.
But when I hit the back button all the information that was previously entered into the page is now gone.

What could I have added to the page that's causing my page to lose all of it's content when I click back?


TIA

Ivo
 
For your back button.. use javascript:

for instance:

<a href=&quot;javascript: history.back(1);&quot;>BACK</a>

This should in theory keep your information intact.. with the exception of password fields. In order for this to work, the end user cannot have their browser cache set to 0.

Cheers,

Gorkem.
 
Actually, I was using VBscript, but I tried what you asked and still all the data is gone. I also checked my cache.

When I manually click the back button on the browser, the same thing happens. There must be something on my form page that's causing this to happen.


 
You could validate it on the same page, then if its valid go onto the confirm page


action=&quot;form.asp?verify&quot;
Code:
If Request.QueryString = &quot;verify&quot; then

  If len(Request.Form(&quot;email&quot;)) < 3 and Instr(Request.Form(&quot;email&quot;), &quot;@&quot; < 1 then

       Response.write &quot;Your email is invalid. Please fix this and try submit the form again.&quot;
       ThereIsError = True

End if 
' and so on..


Then..

If ThereIsError <> True then
Response.Redirect &quot;complete.asp&quot;
end if


in your text boxes put

<%=Request.Form(&quot;name&quot;)%>
in each field
so it keeps the values in the form..
www.vzio.com
star.gif
/ [wink]
 
Put personaly I like doing my errors above each field, its much better for the user, they are more likely to stick around and fix errors etc..

Here is pic I showed someone else on the forums which explains what I mean..

verify.jpg


- Jason www.vzio.com
star.gif
/ [wink]
 
How about posting the form to itself. Then you could put this:
Code:
<% If ErrEmail = True Then %>
YOur email is empty or invalid
<input type=&quot;text&quot; name=&quot;email&quot; value=&quot;<%=Request.QueryString(&quot;email&quot;)&quot;>
<% End If %>
[Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]&quot;Experimentation by Example is the best learning tool&quot; - Exodus300[/red]
[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top