'

[Irl-dean] HTML Question - Forms, labels and table based layouts

Joshue O Connor joshue.oconnor at ncbi.ie
Thu Apr 17 14:36:38 IST 2008


Hi Eoin,

> If I were to code this up as a table - 
[...]
> 
> (for example:
> <table> 
> <tr>
> 
> 	<th id="authorname">Author Name</th>
> 	
> 	...etc
> 
> </tr>
> <tr>
> 	<th id="book1">Book 1</th>
> 	
> 	<td headers="authorname book1">
> 		<input type="text".....
> 	</td>
> 
> 	...etc
> 
> 
> </tr>
> </table>
> )
> 
> would a screenreader understand that the "Author Name and Book 1 headers"
> were essentially the "label" for the input field?

No. This is not really the right approach as they are not 
programmatically determined. You are merely using the table headers as 
containers for the form controls. You shouldn't really use tables like 
this to define the relationship as this is really only of use to sighted 
people. If the label elements are marked up correctly then you could use 
<divs> (which are semantically meaningless). Marking up your forms 
correctly means that the screen reader user can then easily associate 
form controls with their labels etc [1] [2] [3] [4].

Screen reader users often navigate to form controls using the readers 
controls, such as pressing the F key in JAWS, or E to jump to edit 
boxes, or pressing the INSERT + F3 keys and getting a dialogue box which 
lists all of the HTML elements on the page that the user can navigate to 
then by browsing the list. These methods allow them to by-pass their 
containers (such as the table that you mention) so they therefore need 
to be associated with their labels using the correct label for/id 
combinations (see links for more).

HTH

Josh

[1] http://www.webaim.org/techniques/forms/
[2] http://www.webaim.org/techniques/formvalidation/
[3] http://www.webstandards.org/learn/tutorials/accessible-forms/advanced/
(ignore the bit about access keys in the Webstandards one...
[4] http://juicystudio.com/article/form-help-without-popups.html



********************************************************************

NOTICE: The information contained in this email and any attachments 
is confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of 
the content of it or of any attachment; you are requested to notify 
the sender immediately of your receipt of the email and then to 
delete it and any attachments from your system.

NCBI endeavours to ensure that emails and any attachments generated 
by its staff are free from viruses or other contaminants.  However, 
it cannot accept any responsibility for any such which are 
transmitted.  We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email 
and any attachments are those of the author and do not necessarily 
represent the views of NCBI


********************************************************************






More information about the CEUD-ICT mailing list