Re: reloading forms and keeping variables.

From: Date: Thu, 27 Jul 2000 21:56:58 +0000
Subject: Re: reloading forms and keeping variables.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8676@lists.php.net to get a copy of this message
On Thu, 27 Jul 2000, Adrian Smith wrote: > I have a form that the user fills in which is then reloaded to check to all > the fields are filled correctly, if they are not, variables are changed to > the value of 1 which the page then picks up on and alerts the user to fill > in each field that isn't correct, however, the page does not keep the values > of the fields the user has filled in already, its as if the user just loaded > the page. If I'm following you right, something like this may be helpful. Since you're submitting the form to itself, you can easilly use <input type="text" name="variablename" value="<? echo $variablename ?>"> so that when you submit the form the first time, its default value after submission will be the value that the user specified. Unfortunately, this only works for text fields or textareas. You'd need to do a bit more work for check/radio buttons or select lists. Matt

« previous php.general (#8676) next »