Viewing 2 replies - 1 through 2 (of 2 total)
  • In addition, this plugin, which I likewise think is great, raises another error using the W3C validator. Simple Basic Contact Form places a style element within the body element of the webpage. Style elements are valid only in the head element of a webpage; in the body, all style declarations are to be specified in the optional style attribute of a valid body element.

    For example, the following, which Simple Basic Contact Form does, is invalid–

    <div id="simple-contact-form>
       (the form fieldsets, labels and inputs)
    </div>
    
    <style>
       #simple-contact-form fieldset {
          width: 100%; overflow: hidden;
       }
    </style>

    The style declarations should instead be specified in the “style” attribute of a particular HTML element, like this–

    <div id="simple-contact-form>
    (...)
    <fieldset style="width: 100%; overflow: hidden;"> (...) </fieldset>
    (...)
    </div>

    I appreciate the feedback, but there is no harm to having an empty action attribute, nor is there any harm in including style tags within the body. It may not be “proper” but it’s a very common and useful practice. Plus it makes it easy to enable users to add/edit their own CSS for the form via the plugin settings. In this case the pros outweigh the cons.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Validation error’ is closed to new replies.