SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Small Clarification Label element

    Hi,

    How do i define the label tag for this field? I have given the sample code below,

    Code HTML4Strict:
    <label for="PrefStartMonth" class="lbltxt1">Preferred start month/ year:</label>
    <input type="text" id="PrefStartMonth" name="PrefStartMonth" size="10" maxlength="12"
    class="txtbox5" /> /
    <input type="text" id="PrefStartYear" name="PrefStartYear" size="4" maxlength="4" class="txtbox3" />
     
    OR
     
    <label class="lbltxt1">Citizenship:</label> <input type="radio" id="USCitizen" name="Citizenship" value="US Citizen" /> <label for="USCitizen">US Citizen</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" id="NaturalizedUSCitizen" name="Citizenship" value="Naturalized US Citizen" /> <label for="NaturalizedUSCitizen" >Naturalized US Citizen</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" id="PermanentResident" name="Citizenship" value="Permanent Resident" /> <label for="PermanentResident">Permanent Resident</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" id="NonUS" name="Citizenship" value="Not a US Citizen" /> <label for="NonUS" >Not a US Citizen</label>

    Now i have to go and checked the section 503 i got the error message. The message was shown below,

    [WCAG v1 12.4 (AA), US-508-n] No matching <label> tag could be found, or label is empty

    I have define the id('PrefStartMonth') for the first input tag. These input tags defined one label element so i got the error message. How do i solve it these kind of fields.
    Cheers,
    Dinesh

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I don't know what software your using to test but as long as the FOR attribute references the ID attribute then it should be fine, perhaps you missed the FOR or ID in another element? Accessibility testing software is pretty useless to be honest, half the stuff in WCAG needs testing by hand because it's visually implied and computers cannot achieve testing for it as such (it's not code represented).

    More info: http://www.w3.org/TR/WCAG-TECHS/H44.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •