Re: working with forms - loosing data on back button

From: Date: Tue, 11 May 2004 12:03:16 +0000
Subject: Re: working with forms - loosing data on back button
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185898@lists.php.net to get a copy of this message
From: "Merlin" <news.groups@web.de> > The problem I have, is that the publishing is split into 3 screens (steps). If > the user reaches form 2, types something in and clicks on back and then on > forward again he looses the values of the data entered in form 2. > > The back button is done with: javascript:history.back(); so it is totally clear > that the value of the present form is gone. But how to put two different actions > into one form? One for next, one for back? Do you see the problem? > > I would like to avoid saving to a database before the user does not finish the > whole process. There must be another solution. I guess this is a standard > problem and I do just not see the solution?! Save it into the session as they go through the three pages and only save it into the database at the end. Keep track of a $page variable and increment or decrement based on whether they chose the Next>> or <<Prev button and show the appropriate content for the $page. ---John Holmes...

« previous php.general (#185898) next »