• WordPress appears to create post comment forms with HTML5 form validate off (novalidate). How do I tell WP to use HTML5 validation?

    Bob

Viewing 7 replies - 1 through 7 (of 7 total)
  • What theme are you using? Where did you download it from?

    Thread Starter Bob Rockefeller

    (@bobrocke)

    I’m using Genesis 2. The StudioPress folks tell me they use the default WordPress HTML5 form behavior and I need to take care if it there.

    Bob

    There is nothing wrong with the comment form markup that WordPress core generates.

    Thread Starter Bob Rockefeller

    (@bobrocke)

    No, there’s nothing wrong with the markup, it’s just written with the novalidate attribute on and I want to use native HTML5 form validatation, but don’t know how to tell that to WordPress without redoing the whole comment.php file.

    I can’t see any novalidate attribute on the core comment form output.

    Thread Starter Bob Rockefeller

    (@bobrocke)

    It’s there. Check line 2022 in wp-includes/comment-template.php.

    http://d.pr/i/enu9

    Now, how I tell WordPress I don’t want that?

    Bob

    vralle

    (@vit-1)

    I do not know why it was added “novalidate” for the entire form. Probably been difficult for some input. In this case, could be used recommended markup: http://www.w3.org/TR/html5/forms.html#attr-fs-formnovalidate
    Currently to use form validation, you must disable support HTML5:
    remove_theme_support('html5', 'comment-form');
    May be, if needed re-create form fields using form hooks.

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

The topic ‘Turn On HTML5 Comment Form Validation’ is closed to new replies.