Skip to content

Instantly share code, notes, and snippets.

@leafac
Created August 25, 2021 13:26
Show Gist options
  • Save leafac/5b4b1732e7fcc06a0eef0c8105d3034d to your computer and use it in GitHub Desktop.
Save leafac/5b4b1732e7fcc06a0eef0c8105d3034d to your computer and use it in GitHub Desktop.
Quirks of Client-Side Form Validation
  • ‘required’ doesn’t stop the field from being whitespace
  • ‘pattern’ isn’t checked if the field is left empty and it isn’t ‘required’
  • You can do ‘required pattern=".\S."’ if you want a quick-and-dirty solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment