Forms: validation
The best practice is to validate a form on submission. It is recommended to avoid default HTML5 form validation. To turn this off, add the novalidate
attribute to the <form>
element.
Visit the GOV.UK Design system for more advice about form validation.
Client side validation
If client side validation is required, here are some suggested JavaScript libraries:
Alternatively, you could roll your own thanks to Chris Ferdinandi's series on form validation.