Go Back   SitePoint Forums > Forum Index > Program Your Site > Classic ASP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old May 15, 2002, 12:24   #1
Hideki
SitePoint Addict
 
Join Date: Feb 2000
Location: Minnesota
Posts: 317
How can I prevent the forms from clearing when a user hits the back button?

I assume it has to do with cache control, but how do I prevent the form from clearing when a user hits the back button? The form I am referring to is my registration page. After the registration is submitted, they are taken to an error handling page. If an error comes up, they are required to hit the back button and correct the mistake.

It seems like for the most part it retains all of the information in the fields, but occasionally it clears it out. How can I prevent this?

Thanks!
__________________
Keomed.com Webmaster
www.keomed.com
Hideki is offline   Reply With Quote
Old May 15, 2002, 13:02   #2
JimBolla
\m/ R.I.P. Dimebag! \m/
 
JimBolla's Avatar
 
Join Date: Dec 2001
Location: erie, pa
Posts: 1,132
i don't bnelieve this isn't something you have programmatic control over and thus isn't a good method to use. i reccommend modifying your process so that the error message page has a link "back" to the registration screen which actually re-renders the page and populates the inputs with the values from the original form submittal.
JimBolla is offline   Reply With Quote
Old May 15, 2002, 13:04   #3
Hideki
SitePoint Addict
 
Join Date: Feb 2000
Location: Minnesota
Posts: 317
So, a link back to the registration page and the back button function in two different ways?

Thanks!
__________________
Keomed.com Webmaster
www.keomed.com
Hideki is offline   Reply With Quote
Old May 15, 2002, 13:21   #4
JimBolla
\m/ R.I.P. Dimebag! \m/
 
JimBolla's Avatar
 
Join Date: Dec 2001
Location: erie, pa
Posts: 1,132
no its not a back button. you'd actually be going forward technically, although to the registration page again, but the second time the page is rendered, the input boxes are prepopulated with the values provided the first time the you were at the registration page.


Code:
<experiment_in_ascii_art>
your app:

registation.asp --> error.asp
        ^              |
        |              |
        \--------------/



my suggestion:

registration.asp --> error.asp --> registration.asp?input1=value&input2=value&etc.

</experiment_in_ascii_art>
JimBolla is offline   Reply With Quote
Old May 16, 2002, 06:30   #5
Goof
SitePoint Wizard
 
Goof's Avatar
 
Join Date: Feb 2001
Location: Pittsburgh, PA
Posts: 1,153
Haha...I guess that's the best type of diagrams we get
__________________
Nathan Rutman
A slightly offbeat creative.
Goof is offline   Reply With Quote
Old May 16, 2002, 08:31   #6
Hideki
SitePoint Addict
 
Join Date: Feb 2000
Location: Minnesota
Posts: 317
Thanks crowdozer!
__________________
Keomed.com Webmaster
www.keomed.com
Hideki is offline   Reply With Quote
Old May 22, 2002, 07:41   #7
raymo
SitePoint Zealot
 
raymo's Avatar
 
Join Date: Feb 2002
Location: The High Country, Victoria, Australia
Posts: 190
Why create another step (or "click") when you don't need to?

May I suggest simply displaying the error message along with form? And if you want to make it super duper, mark the fields that have invalid entries with something eye catching so the user can immediately spot their mistake. I reckon specifying form border to something bright, ie red, would do the trick.
__________________
ride it like it's stolen
raymo is offline   Reply With Quote
Old May 22, 2002, 08:34   #8
Hideki
SitePoint Addict
 
Join Date: Feb 2000
Location: Minnesota
Posts: 317
Funny you should say that...cuz after some thought, I re-did the entire page just like you mentioned. Hardest part was figuring out what error indication (in my case a red border around the field) was NS compatible as well.

Check out the finished work here. Just go down to the bottom and click the submit button without filling anything in.

-Hideki
__________________
Keomed.com Webmaster
www.keomed.com
Hideki is offline   Reply With Quote
Old May 22, 2002, 10:02   #9
raymo
SitePoint Zealot
 
raymo's Avatar
 
Join Date: Feb 2002
Location: The High Country, Victoria, Australia
Posts: 190
Great minds... *g*

Good job Hideki.
__________________
ride it like it's stolen
raymo is offline   Reply With Quote
Old May 22, 2002, 10:52   #10
fillup07
Phil
 
fillup07's Avatar
 
Join Date: May 2002
Location: Jacksonville, FL
Posts: 1,171
Quote:
Originally posted by raymo
Why create another step (or "click") when you don't need to?

May I suggest simply displaying the error message along with form? And if you want to make it super duper, mark the fields that have invalid entries with something eye catching so the user can immediately spot their mistake. I reckon specifying form border to something bright, ie red, would do the trick.
How would that be done?... the best way?
__________________
Jacksonville website design
fillup07 is offline   Reply With Quote
Old May 22, 2002, 10:58   #11
Hideki
SitePoint Addict
 
Join Date: Feb 2000
Location: Minnesota
Posts: 317
Check out my link three posts up
__________________
Keomed.com Webmaster
www.keomed.com
Hideki is offline   Reply With Quote
Old May 22, 2002, 11:51   #12
raymo
SitePoint Zealot
 
raymo's Avatar
 
Join Date: Feb 2002
Location: The High Country, Victoria, Australia
Posts: 190
fillup07, do you mean [how do you do it] technically?
__________________
ride it like it's stolen
raymo is offline   Reply With Quote
Old May 25, 2002, 23:01   #13
dethfire
SitePoint Wizard
 
dethfire's Avatar
 
Join Date: Aug 2000
Posts: 2,436
or... grab the form values using javascript and refresah the page plugging in the saved values
__________________
Free Science Homework Help
http://www.physicsforums.com
dethfire is offline   Reply With Quote
Old Oct 4, 2002, 13:49   #14
DLG_1
SitePoint Addict
 
DLG_1's Avatar
 
Join Date: Jun 2000
Location: Texas, USA
Posts: 597
what I would do.

onError I would display a gif file next to the field. The gif file would show an arrow flashing between red and white/background color.

I've only seen that in a few places and it's helped me catch mistakes much faster!

imho.
DLG_1 is offline   Reply With Quote
Old Oct 5, 2002, 01:14   #15
iamnomad
SitePoint Zealot
 
Join Date: May 2002
Location: New Zealand
Posts: 147
if you add a hidden field to your form, called for example submitted with a value of "0" or something then post the form back to itself and include this in your <% block%>

if request.form("Submitted")="0" then ' forms submitted

strMessage="<ol>"

validate form item
oops error
strMessage ="<li>you dim wit!</li>"
blncheck = false


if blncheck then
...forms ok so proceed
end if

strMessage = strMessage&"</ol>"
end if
<html>
<%=strMessage%>
iamnomad is offline   Reply With Quote
Old Oct 5, 2002, 03:08   #16
Omair Haroon
SitePoint Wizard
 
Join Date: Dec 2000
Location: Karachi, Pakistan
Posts: 913
You could always use session variables to save the information typed by the user. So in this way, even if he had to click the back button, the values would have been saved and would be displayed even if the page loaded.

Just my 0.2!

--Omair
__________________
36Host.com - $36/year web hosting [affiliates earn 30%]
* Affordable Small Business Web Hosting since 2003! *
"500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
mysql, pre-installed php scripts, 24/7 support & more...."


Omair Haroon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

 
Forum Jump


All times are GMT -7. The time now is 09:25.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved