The formNoValidate
property sets or gets
whether the form data should be validated or not, when submitted.
formNoValidate |
Yes | 10.0 | Yes | Yes | Yes |
Return the formNoValidate property.
var v = submitObject.formNoValidate
Set the formNoValidate property.
submitObject.formNoValidate=true|false
Value | Description |
---|---|
true|false | Set whether the form-data should be validated when submitted
|
A Boolean type value, true if the form-data should not be validated, otherwise false.
The following code shows how to set the formNoValidate property.
<!DOCTYPE html>
<html>
<body>
<!-- w w w . ja v a 2 s . co m-->
<form action="demo_form.asp" method="get">
E-mail: <input type="email" name="userid"><br>
<input type="submit" id="mySubmit" value="Submit" formnovalidate>
</form>
<button onclick="myFunction()">test</button>
<script>
function myFunction() {
document.getElementById("mySubmit").formNoValidate = false;
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to get if the form-data should be validated or not.
<!DOCTYPE html>
<html>
<body>
<!-- w w w .j ava2s .c o m-->
<form action="demo_form.asp" method="get">
E-mail: <input type="email" name="userid"><br>
<input type="submit" id="mySubmit" value="Submit" formnovalidate>
</form>
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("mySubmit").formNoValidate;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: