HTML
  Home arrow HTML arrow Page 4 - Building Accessible Web Forms
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Building Accessible Web Forms
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 17
    2005-02-07

    Table of Contents:
  • Building Accessible Web Forms
  • The basics of form layout
  • Improving accessibility with the "label" tag
  • Styling "label" tags for greater accessibility
  • Adding usability to forms

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building Accessible Web Forms - Styling "label" tags for greater accessibility


    (Page 4 of 5 )

    Since <label> elements are common HTML tags, we are able to apply styles to them, as we usually do with other HTML elements. A nice approach is to style <label> elements, applying some bold fonts to make the label text stand out from the other text in the form, such as:

    label {

        font: bold 12px "Arial", Helvetica, sans-serif;

        color: #000;

    }

    With this set of rules, all of the label text will be displayed using a bolded font. As we've seen above, a <label> tag not only makes it easier for screen readers to identify the input, it's also gives the user a larger area to click on. This is particularly useful when used with radio buttons and checkboxes.

    If we have defined the text associated with the label element, the clickable area will be extended not only to the form control, but it will enclose the text as well. Most software applications have been implementing this as the standard for many years, if we think it that way:

    For years, software applications have applied the concept of making the text associated with checkboxes completely clickable, as shown in the above image.

    The same functionality can be achieved using the <label> tag in online forms, as we clearly see in the example below:

    The whole area, including the form control and the related text, is clickable when we're utilizing the <label> element. What's more, we can boost this technique, visually indicating to visitors that the entire section can be clicked, taking advantage of this extra functionality. With some CSS rules, we might suggest to visitors this condition:

    label {

        font: bold 12px "Arial", Helvetica, sans-serif;

        color: #000;

        cursor: hand;

    }

    When the user passes the mouse over the whole <label> area, the cursor will change its pointer, indicating that the entire section is clickable, and the text will set the focus to the form control. However, there is a drawback to this approach, since the "cursor" property is not fully supported by most browsers. With the pros and cons inherent in this approach, it's up to you to decide what is more important for your website.

    At this point, we have demonstrated how useful <label> elements can be when they're used in online forms. Now, let's move away slightly from general accessibility and go deeper into the field of usability. Let's present some general guidelines for making forms more usable.

    More HTML Articles
    More By Alejandro Gervasio


       ·  The articles goes through the basic of building accessible forms, using some...
       · Accessibility of forms is only partly a technical issue. Adding labels is a grand...
       ·  Your point is good and valid. Certainly,optgroup is perfectly valid to be added...
       · Although I agree with this poster's views, I believe the article will open the eyes...
       · Hello,I hope that the use of label,fieldset and optgroup is well worthy to be...
     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT