There is no jQuery Validate plugin callback function / function that fires when all fields are valid without first clicking the submit button.
You will need to create an external keyup blur event handler that checks your form for validity and accordingly enables / disables this button; every time a key is pressed or you leave the field.
DEMO: http://jsfiddle.net/p628Y/1/
$(document).ready(function () { $('#ccSelectForm').validate({ rules: { inputEmail: { required: true, email: true }, inputEmailConfirm: { // required: true, // <-- redundant // email: true, // <-- redundant equalTo: '#inputEmail' } // <-- removed trailing comma } }); $('#ccSelectForm input').on('keyup blur', function () { // fires on every keyup & blur if ($('#ccSelectForm').valid()) { // checks form for validity $('button.btn').prop('disabled', false); // enables button } else { $('button.btn').prop('disabled', 'disabled'); // disables button } }); });
Since the jQuery Validate plugin disables the HTML5 check of the browser dynamically, I removed the required attribute from your markup and changed type="email" to type="text" . (You already have these validation rules specified in the plugin.)
<input type="text" name="inputEmail" placeholder=" jane.smith@email.com " id="inputEmail" /> <input type="text" name="inputEmailConfirm" placeholder=" jane.smith@email.com " id="inputEmailConfirm" />
You also do not need to specify all the rules twice when using the equalTo rule, since the second field should always match the first.
EDIT:
In the above scenario, your page is completely JavaScript dependent. In other words, without JavaScript, the button is always disabled.
If you have server-side validation and you want your page not to depend on JavaScript, you need to remove disabled="disabled" from the layout of your button and add it to your JavaScript right inside the DOM ready event handler.
$('button.btn').prop('disabled', 'disabled');
In this scenario, without JavaScript, you will still have a working button, and with JavaScript, the button will be automatically disabled when the page loads.