Why is WordPress ignoring required field?

I have a comment form under my posts where users must fill in their name and their email. In the page source it also shows the input field has required="required". Yet the form still posts even when there is nothing inserted and does not show the supposed message which should work in HTML5. I am also checking the input server side but I like the default HTML5 messages so I would love them to work.
I’m currently using the latest WordPress version.

Related posts

2 comments

  1. in function.php (delete: ‘comment-form’):

    add_theme_support('html5', array(
        'search-form',
        <s>'comment-form',</s>
        'comment-list',
        'gallery',
        'caption'
    ));
    

    form novalidate

  2. you said > input type=”text” required=”required” name=”bar” placeholder=”required”

    and I said > input type=”text” required name=”bar” placeholder=”required”

    there’s a slightly difference, check and let me know.

Comments are closed.