Skip to content

Instantly share code, notes, and snippets.

@hoanganh25991
Created January 8, 2016 15:18
Show Gist options
  • Save hoanganh25991/7736bf50d6a1b75521d6 to your computer and use it in GitHub Desktop.
Save hoanganh25991/7736bf50d6a1b75521d6 to your computer and use it in GitHub Desktop.
html-validate setCustomValidity
<form method="POST">
<fieldset><legend>Example 3</legend>
<span><label><input id="field_terms" type="checkbox" required name="terms"> I accept the <u>Terms and Conditions</u></label></span>
<span><input type="submit"></span>
</fieldset>
</form>
<script type="text/javascript">document.getElementById("field_terms").setCustomValidity("hoang anh le");</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment