Form noValidate Property - Set the noValidate property: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form

Description

Form noValidate Property - Set the noValidate property:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form id="myForm" action="#">
  E-mail: <input type="email" name="user_email">
  <input type="submit">
</form>/*  w  w  w.j av a2 s. c om*/

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("myForm").noValidate = true;
    document.getElementById("demo").innerHTML = "The novalidate attribute is now added to the form element, and the form-data will NOT be validated on submission.";
}
</script>

</body>
</html>

Related Tutorials