[jQuery] Bind Validate to button click event
I am walking into an existing form that uses a custom ajax request to
display search results at the button of the page. This is triggered by
clicking a form button. I want to trigger the validation on this same
click event rather than a submit event. I am just using basic
validation at the moment.
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$('#testBlog').validate();
$('#searchButton').click(function(){
formDoAjaxSubmit();
});
});
</script>
<form id="testBlog" name="testBlog">
<select name="catSelectList" id="catSelectList" class="required"
title="Please Select a Category" style="width:610px" >
<option>....</option>
<option>....</option>
<option>....</option>
<option>....</option>
</select>
<input type="button" value="Submit this Query!"
id="searchButton">
</form>