• Hello,

    The built in markup used by Contact Form 7 does not abide to current HTML standards. When running my site in the official W3C validator I get errors like:

    Error Line 15, Column 6816: The for attribute of the label element must refer to a form control.
    …ss="form-group"><label for="s-message">Viesti</label><span class="wpcf7-form-c…

    Details:
    https://validator.w3.org/check?uri=http%3A%2F%2Fseravo.fi%2Fyhteydenotto

    I think the fix would be to add duplicate the ‘name’ attribute and value to also be printed out as a ‘id’ attribute and value. Another possible option would be to extend the label element to include the input element, so you don’t need any ‘for’ attribute markup at all.

    Twitter Bootstrap, which is kind of golden standard on proper HTML markup, uses this kind of notation:

    <label for="exampleInputEmail1">Email address</label>
        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘W3C validation errors’ is closed to new replies.