Note #25383

Today I learned that you can use reportValidity() on a HTML5 input of e.g. type="email" to force the browser to run it’s own validation, without waiting for the containing form to be submitted (which in some cases might not happen, e.g. if you’re handling input using JS).

That’s cool.

0 comments

    Reply here

    Your email address will not be published. Required fields are marked *

    Reply on your own site

    Reply elsewhere

    You can reply to this post on Mastodon (@dan@danq.me), Mastodon (@blog@danq.me).

    Reply by email

    I'd love to hear what you think. Send an email to b25383@danq.me; be sure to let me know if you're happy for your comment to appear on the Web!