By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Clear Button malfunction on HTML form generated by PHP

P: n/a
I have a HTML form that is generated in part by PHP. The action
attribute on the form tag calls itself, so that I can validate the
fields without using any other form of code like Javascript to
validate fields, etc.

All works well; fields like e-mail addresses are correctly validated
with one notable exception.

The <input type="reset" ... only works the first time the form is
called.

If there are any problems with the fields, causing the form to refresh
with advisory data, then the Clear button does not function.

I am unable to explain this. Has anyone spotted anything similar? Do
you know why? Is there a workaround?

Many thanks.

John
Dec 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, 11 Dec 2007 14:32:31 +0100, <jo********@gmail.comwrote:
I have a HTML form that is generated in part by PHP. The action
attribute on the form tag calls itself, so that I can validate the
fields without using any other form of code like Javascript to
validate fields, etc.

All works well; fields like e-mail addresses are correctly validated
with one notable exception.

The <input type="reset" ... only works the first time the form is
called.

If there are any problems with the fields, causing the form to refresh
with advisory data, then the Clear button does not function.

I am unable to explain this. Has anyone spotted anything similar? Do
you know why? Is there a workaround?
<input type="reset"doesn _not_ empty all the values, rather it resets
all form values to the one in the HTMl source.
<http://www.w3.org/TR/html4/interact/forms.html#reset-button>

So if you're kind enough to provide them with the previous values so
they'll only have to change the incorrect one, those will be set. If you
want a 'clear' button instead of a 'reset' button, you'll either have to
use some javascript to do that, or make it a submit button and return a
crisp form to the user on that post value.
--
Rik Wasmus
Dec 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.