DEV Community

Discussion on: Native form validation with JavaScript

Collapse
 
nicozerpa profile image
Nico Zerpa (he/him)

I loved how you explain things, Ryan! I didn't know about the Norman Nielsen Guidelines, I'll definitely use them in my projects.

As far as I understand, the API has two ways to run code when a field is invalid, is that correct? You can use a simple if(!field.validity.valid), but you also call field.checkValidity() and handle the invalid event.

Collapse
 
falldowngoboone profile image
Ryan Boone

Correct. Thanks for the kind words!