[thelist] clear form code
M. Seyon
evoltlist at delime.com
Mon Mar 20 10:37:05 CST 2006
Message from Matt Warden (3/20/2006 11:13 AM)
> > > You asked for a valid reason for using the Reset button, and I
> > > provided one - resetting radio buttons that do not have either a
> > > default state, or a "none selected" option.
>
>This is actually an invalid use of radio buttons. See:
>
>http://www.w3.org/TR/REC-html40/interact/forms.html#radio
Matt,
That page states:
"If no radio button in a set sharing the same control name is initially
"on", user agent behavior for choosing which control is initially "on" is
undefined."
It does go on to say that:
"Note. Since existing implementations handle this case differently, the
current specification differs from RFC 1866 ([RFC1866] section 8.1.2.4),
which states:
'At all times, exactly one of the radio buttons in a set is checked...'"
However, it seems this existing specification does not explicitly state
that a radio button set must have one button that is checked. Rather, it
says "user agent behaviour... is undefined".
John, you said:
"This is a usability problem - and the usability problem is that someone's
misusing radio buttons.
In your example, the form *should* be using checkboxes."
To reference the same page Matt pointed me to, the specification clearly
states:
"Radio buttons are like checkboxes except that when several share the same
control name, they are mutually exclusive: when one is switched "on", all
others with the same name are switched "off"."
How is it a misuse of radio buttons to use them where the form designer
wants ONLY ONE option checked?
Yes, you could use javascript and/or server side validation to ensure that
no more than one is selected but that seems like jumping through hoops to me.
>What reset *is* useful for is taking a form back to its initial
>values. It is not a "clear form" button, unless the initial state of
>the form is valueless.
Agreed and understood.
>You *might* be able to get the same results by hitting "refresh", but
>this might not always be possible
Which is exactly why, in my opinion, there is value in a Reset button, when
used appropriately.
More information about the thelist
mailing list