Skip to content

Instantly share code, notes, and snippets.

@gerasimua
Last active October 2, 2015 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerasimua/4945c311a5bd83ea89df to your computer and use it in GitHub Desktop.
Save gerasimua/4945c311a5bd83ea89df to your computer and use it in GitHub Desktop.
Some example of custom message on HTML5 validation error
<input type="text" class="form-control input-lg verify-code-field" data-bind="value: verifyCode"
required pattern="\d{4}" oninvalid="setCustomValidity('Please type 4 digit code')" onchange="try{setCustomValidity('')}catch(e){}"
placeholder="Enter your 4 digit code to claim"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment