Re: Form data is not "remembered"

From: Date: Wed, 24 Jan 2001 17:30:10 +0000
Subject: Re: Form data is not "remembered"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-36438@lists.php.net to get a copy of this message
If the form page is not being cached, it would probably get reloaded when they clicked back, thus losing the data. I'd suggest redrawing the form with the fields populated and with the appropriate error messages. Then you don't need to mess with caches or sessions for that matter, and the user doesn't need to take an extra step to get back to the form. Alain Fontaine wrote: > > Hi, > > I have a page with a couple of form fields that are being POSTed to a > processing PHP script. The page that contains these form fields is itself a > PHP page that uses sessions and so on. > > I have to make "server-side data validation" on the fields because of their > complexity. When the user hits submit and comes to the result page, if there > was any error I ask the user to go back to the form and correct the > mistakes, using either his browser BACK button or by clicking on a link that > does a javascript:history.back(). > > The problem is, when the user gets back to the form page, all of the values > he had typed in are gone, and he has to start all over again. Does anyone > have an idea why this is so, and how to circumvent it without saving the > user data into a session variable and then setting it back again once the > user hits the form page again ? I have seen many pages where your previous > data would stay in the form after you make a "Back" operation, but here, it > disappears. > > Thanks for any ideas, and have a very nice day. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.general (#36438) next »