invoking jquery validator

JavaScript
$(document).ready(function () {

    $('#myform').validate({ // initialize the plugin
        // rules & options
    });

    $('#button').click(function() {
        if ($('#myform').valid()) {
            alert('form is valid - not submitted');
        } else {
            alert('form is not valid');
        }
    });

});
function submitFunction(event){
	event.preventDefault();
}
$("#form_id").submit(submitFunction);
Source

Also in JavaScript: