Support » Plugin: Contact Form 7 » Accessibility – Remove tag

  • Resolved meinekleinehomepage


    Hello 🙂

    I have installed Contact Form 7 on a clients website and now I am trying to get it accessible regarding the w3c rules for accessible websites.

    I added <label> tags to the form (example below)
    <label for="email" style="width: 100%;">Ihre Email-Adresse [email* your-email id:email]</label>

    If I test the site with the w3c validator (w3c accessibility validator), I get an error like this:

    Error: Element div not allowed as child of element label in this context. (Suppressing further errors from this subtree.)
    From line 674, column 50; to line 674, column 83

    >Ihr Name <div class=”form-group your-name”><input

    Contexts in which element div may be used:
    Where flow content is expected.
    As a child of a dl element.
    Content model for element label:
    Phrasing content, but with no descendant labelable elements unless it is the element’s labeled control, and no descendant label elements.

    Do you know how I can get rid of the <div> tag without braking the form?

    Thank you!


    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi


    <div class="form-group your-name">

    This is not output by Contact Form 7. Do you use a plugin to change Contact Form 7’s output? If you are not sure, try deactivating all other plugins, and if you still see the same output, try switching theme to the default one (Twenty Seventeen).

    Yes, it was a Plugin! (Custom Form 7 Bootstrap)

    Thank you very much! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.