anonymous / gist:1103051
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

3.8.1 Customizing the validation messages

View gist:1103051
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script>
function addCustomValidation() {
var fldName = document.getElementById('fullname');
fldName.form.onsubmit = function () {
fldName.setCustomValidity("");
if (!fldName.validity.valid) {
fldName.setCustomValidity("Nameless ones are not allowedto take part");
}
};
}
</script>
</head>
<body onload="javascript:addCustomValidation();">
<form>
<label>Full name: <input id="fullname" /></label> <br/>
<input type="submit" value="Enviar">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.