Re: [VE][html5] The for attribute of the label element must refer to a form control.

On Fri, Aug 3, 2012 at 4:14 AM, Peter Mitchell <anetaweta@gmail.com> wrote:
> I am trying to fix the error I encounter when validating my site.  The error
> is a 'The for attribute of the label element must refer to a form control.'
> unfortunately I do not know what this means.

It means the value of the @for attribute of the <label> element must
match the (unique) @id attribute of the form field it is labelling.

e.g.

<label for="orderby">Sort by:</label>
<select id="orderby" name="whatever">
  <option>name</option>
  <option>date</option>
</select>

http://developers.whatwg.org/forms.html#attr-label-for

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

--
Benjamin Hawkes-Lewis

Received on Friday, 3 August 2012 15:41:36 UTC