Re: Keeping form fields populated

From: Date: Thu, 15 May 2003 22:01:41 +0000
Subject: Re: Keeping form fields populated
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-147828@lists.php.net to get a copy of this message
At 5/15/2003 05:48 PM, Brian V Bonini wrote:
Once it's submitted and those values are set via PHP echo the reset button will not clear out those fields.
...
Which makes sense as it's default value is now what's contained on the value field.
Exactly.
So, I guess what I need to do is have reset reload the form (which I know how) and empty out all the $vars... ???
You can't. At least, not permanently. You can use Javascript to "empty" the fields, but if the user refreshes, all the values would come back. Instead of <input type="reset"> You would use <input type="button" onClick="document.myForm.myFieldName.value='';" value="Clear"> Or, if you want to clear out everything, then you have the javascript null the values and then submit the form. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: skeller@healthtvchannel.org Web: www.healthtvchannel.org

« previous php.general (#147828) next »