Clear Button malfunction on HTML form generated by PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnacooke@gmail.com

    #1

    Clear Button malfunction on HTML form generated by PHP

    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
  • Rik Wasmus

    #2
    Re: Clear Button malfunction on HTML form generated by PHP

    On Tue, 11 Dec 2007 14:32:31 +0100, <johnacooke@gma il.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"doe sn _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#rese t-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

    Comment

    Working...