W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 1999

Re: Suggestions for Forms?

From: Kynn Bartlett <kynn-hwg@idyllmtn.com>
Date: Fri, 25 Jun 1999 13:33:56 -0700
Message-Id: <4.1.19990625132006.01e7f2e0@mail.idyllmtn.com>
To: "webmaster@dors.sailorsite.net" <webmaster@dors.sailorsite.net>
Cc: "'Web Accessibility Initiative'" <w3c-wai-ig@w3.org>
At 12:53 PM 6/25/1999 , Bruce Bailey wrote:
>I've looked at the WCAG regarding forms, and I am a little mystified 
>regarding suggestions for the LABEL attribute.

The LABEL tag identifies a section of text as being the "label"
for a given part of a form.  For example, on www.hwg.org, the
titles of each search are the "label" associated with the search
box directly below.  They serve to explain what it's for.

In your case, you want to change:

      <TR>
        <TH align=right valign=top>Search&nbsp;For:</TH>
        <TD><INPUT type=text name=search_for value="." size=40></TD>
      </TR>

To read:

      <TR>
        <TH align=right valign=top>
          <LABEL FOR="search_for">Search&nbsp;For:</LABEL>
        </TH>
        <TD><INPUT type=text ID="search_for"
                   name=search_for value="." size=40></TD>
      </TR>

This will make it obvious that the text "search for" describes the
following box.

Why is this necessary?  Well, it's obvious to you or me when we
look at the page what it's there for.  But that's because we can
understand the text and can see the visual location of the elements.

A computer, however, can't understand that.  The benefit of the
LABEL is that it EXPLICITLY tells the computer in a machine-readable
form what label is associated with which form control.  This
allows the browser to restructure the form in a way that will
be more accessible to the user.  Without this information, it
would have to guess.

>The utility of ACCESSKEY 
>also excapes me for this purpose (only two parameters, and one uses radio 
>buttons).

ACCESSKEY is problematic and needs to reconsidered; I would
advise _against_ this for now.

However, I would suggest that a pulldown list might be more
usable than a list of radio checkboxes, from both an accessibility
standpoint (the text is better associated with the value of the
control) and an aesthetics view.

>I've followed the suggestion for putting in "starter" text (using VALUE), 
>but this is ugly.  Does it really help?  Is there a way to have the starter 
>text "selected" so that if the user types (without clicking) the text that 
>was already there would disappear?  Databases frequently work this way.

This depends on the browser being used.

>Is it desireable to avoid forms?

Not really, it's just desirable to (a) do them "right" (meaning with
accessibility features), and (b) if possible, design alternate ways
to access the same information, such as a generated-on-the-fly
index.

>I am just starting with PERL and am feeling really brain dead at this 
>point.  Can anyone give me the PERL script for deleting a leading period or 
>space from a scalar variable?

Untested, and keep in mind that perl has 17581124718 ways to do
anything, and I always use the worst way :)

$scalar =~ /^[. ]*(.*)$/;
$scalar = $1;


--
Kynn Bartlett                                    mailto:kynn@hwg.org
President, HTML Writers Guild                    http://www.hwg.org/
AWARE Center Director                          http://aware.hwg.org/
Received on Friday, 25 June 1999 16:42:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:13:44 GMT