.valid()

.valid()

Checks whether the selected form is valid or whether all selected elements are valid.

Description

validate() needs to be called on the form before checking it using this method.

Usage

.valid()

This signature does not accept any arguments.

Examples

Sets up validation for a form, then checks if the form is valid when clicking a button.

var form = $( "#myform" );
form.validate();
$( "button" ).click(function() {
	alert( "Valid: " + form.valid() );
});
<form id="myform">
	<input type="text" name="name" required>
	<br>
	<button type="button">Validate!</button>
</form>