Here's one way to do it:
<input type="button" id="submit_btn" value="Submit"/>
$("#ajax_form").validate( [set validation options] );
$("#submit_btn").click(function() {
var valid = $("#ajax_form").valid(); // returns true or false
if (valid) {
// do ajax submission
}
});
On Jul 14, 7:33 am, ButtersRugby <[email protected]> wrote:
> I am trying to figure out how to submit the form using the $.ajax
> call.
>
> How do I make sure my form is valid when submitting via a click event
> on a button?
>
> do i put it in the submitHandler of the validation plugin?
>
> submitHandler: function(form) {
> $('mybutton').click(function () {
> $.ajax ({
> //stuff in here?
>
> })
> }
>
> }
>
> I want to make the form is valid when I click to submit, and do an
> ajax form submission. Hopefully without yet another plugin.
>
> Thanks.