Support » Plugins » [Plugin: Contact Form 7] Generating invalid HTML

  • My Contact Form 7 form setup pane looks like:

    <fieldset><legend>Submit an Event</legend>
    <label for="your-name" class="wpcf7">Your Name (required):</label> [text* your-name]
    <br />
    <label for="your-email" class="wpcf7">Your Email (required):</label> [email* your-email]

    But the generated HTML is

    <fieldset>
    <legend>Submit an Event</legend>
    <p><label for="your-name" class="wpcf7">Your Name (required):</label> <span class="wpcf7-form-control-wrap your-name"><input type="text" name="your-name" value="" class="wpcf7-validates-as-required" size="40" /></span><br />
    <br />
    <label for="your-email" class="wpcf7">Your Email (required):</label> <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span><br />

    Note the extra “<p>” after the “</legend>“.

    Deleting the new-line between the closing legend and the open label tags doesn’t make a difference — the spurious p tag still shows up.

    Since it’s never closed, it generates HTML validation errors.

    It’s not a huge deal, but I thought I’d report it in case anyone has a workaround or a patch.

    Thanks for the plugin!

    Contact Form 7 version: 2.2

    http://wordpress.org/extend/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks. I’ll take a look.

    Sorry — it looks as if something else is going on.

    I’d still rather not have the “<p>”s inserted, I guess, but it does appear that they are closed correctly within the form and I understand why it makes sense to have them as the default.

    Seems like there is a bug in the current version (2.2) of Contact Form 7. I’ll fix it in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Contact Form 7] Generating invalid HTML’ is closed to new replies.