WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] Generating invalid HTML (4 posts)

  1. converting2wp
    Member
    Posted 4 years ago #

    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/

  2. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    Thanks. I'll take a look.

  3. converting2wp
    Member
    Posted 4 years ago #

    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.

  4. Takayuki Miyoshi
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic