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

additional label question

From: <Sebastiano.Nutarelli@csi.it>
Date: Fri, 1 Apr 2005 19:25:02 +0200
To: <w3c-wai-ig@w3.org>
Message-ID: <OFBD16AE1B.3482C293-ONC1256FD6.005DCA6F-C1256FD6.00600EB5@csi.it>
You can't associate multiple text boxes with the same label, to do it you
have to put two equal id, and XHTML code wouldn't be valid..
About you code example and about accessibility you shoud consider that
screen readers often aren't able to read table "linearized" and so it could
be useful put a hide label just for blind people -->
XHTML:
        ... <tr>
                        <th scope= “col”>ID</th>
                        <th scope= “col”>First Name</th>
                        <th scope= “col”>Last Name</th>
            </tr>
            <tr>
                        <td><label for="a"><span class="hide">Insert
ID</span></label><input type=”text” name=”id1” id="a" /></td>
                        <td><label for="b"><span class="hide">Insert first
name</span></label><input type=”text” name=”fname1” id="b" /></td>
                        <td><label for="c"><span class="hide">Insert last
name</span></label><input type=”text” name=”lname1” id="c" /></td>
            </tr> ...
  CSS2:         .hide{position: absolute;top: -10000px;left:-10000px;width:
0;height:0;clear:none;}

Use left off tecnique to put out of page contents included in tag with
class="hide"


And more: why you put scope="row" in your first cells every row?
In your example isn't useful..
Cheers

Sebastiano Nutarelli
IWA/HWG Member
W3C WCAG WG Member
----- Inoltrato da Sebastiano Nutarelli/CSI/IT il 01/04/05 19.08 -----
                                                                                                                                      
                      "Beheler Kim"                                                                                                   
                      <beheler_kim@bah.        Per:      <w3c-wai-ig@w3.org>                                                          
                      com>                     Cc:                                                                                    
                      Inviato da:              Oggetto:  additional label question                                                    
                      w3c-wai-ig-reques                                                                                               
                      t@w3.org                                                                                                        
                                                                                                                                      
                                                                                                                                      
                      01/04/05 18.56                                                                                                  
                                                                                                                                      
                                                                                                                                      




Hi everyone,

I have another question regarding label tags for form fields.  I have a
data table that has input boxes in each cell.   Do the label tags need to
be associated with the appropriate text in this situation, since the data
cell is already associated with the header?  If so, is it possible to
associate multiple text boxes with the same label and how would you go
about it?   An example of code as follows:

<table align="center" width="80%" cellpadding="2">
            <tr>
                        <th scope= “col”>ID</th>
                        <th scope= “col”>First Name</th>
                        <th scope= “col”>Last Name</th>
            </tr>
            <tr>
                        <td scope=”row”><input type=”text” name=”id1”
/></td>
                        <td><input type=”text” name=”fname1” /></td>
                        <td><input type=”text” name=”lname1” /></td>
            </tr>
            <tr>
                        <td scope=”row”><input type=”text” name=”id2”
/></td>
                        <td><input type=”text” name=”fname2” /></td>
                        <td><input type=”text” name=”lname2” /></td>
            </tr>
</table>

Thanks in advance for your help,
Kim
Received on Friday, 1 April 2005 17:24:18 GMT

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