DEV Community

Discussion on: Complete JavaScript Form Validation

Collapse
 
pfacklam profile image
Paul Facklam

Good article! As an alternative I would like to propose another approach. You don't need Javascript at all. HTML input elements provide all you need:

  • a required attribute
  • a pattern attribute (e.g. for email validation)
  • an attribute for min, minlength, max and maxlength

These things are already available as browser funtionalities. How cool is this?

Collapse
 
stackfindover profile image
Stackfindover

Nice thanks