Title: W3C validation errors
Last modified: August 21, 2016

---

# W3C validation errors

 *  Resolved [Otto Kekäläinen](https://wordpress.org/support/users/ottok/)
 * (@ottok)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-errors-5/)
 * 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:
    [http://validator.w3.org/check?uri=http%3A%2F%2Fseravo.fi%2Fyhteydenotto](http://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">
       ```
   
 * [http://wordpress.org/plugins/contact-form-7/](http://wordpress.org/plugins/contact-form-7/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-errors-5/#post-4479722)
 * The _for_ attribute of the _label_ element must refer to the _id_ attribute value
   of a form control element. Your `<label for="s-message">Viesti</label>` refers
   to `id="s-message"`, but there is no element with `id="s-message"` on [your page](http://seravo.fi/yhteydenotto).
   Instead, you have a _textarea_ element with `name="s-message"`.
 * Try setting id to the textarea.
 * [http://contactform7.com/text-fields/#textarea](http://contactform7.com/text-fields/#textarea)
 *  Thread Starter [Otto Kekäläinen](https://wordpress.org/support/users/ottok/)
 * (@ottok)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-errors-5/#post-4479752)
 * I have now manually added paramater ‘id’ to all fields but still I suggest that
   it should maybe be automatic that name=id?
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-errors-5/#post-4479756)
 * Id needs to be unique in a page. Name doesn’t. They are completely different.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘W3C validation errors’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/w3c-validation-errors-5/#post-4479756)
 * Status: resolved