Input type button/submit that does both form validation and submit via jquery ajax?


Input type button/submit that does both form validation and submit via jquery ajax?



I am trying to use jquery validator plugin and form submit via ajax in jquery.....

Validator plugin works with <input type="submit" value="Add a client" id="clientadd"/> but my form submit works with <input type="button" value="Add a client" id="clientadd"/>.....

<form id="addform" autocomplete="off">  //My controls here </form> 

I didn't specify action and method attributes here as i ll submit my form using jquery.ajax().... Any suggestion how to get both working together....


ASP.NET MVC Cookie loses value when page is changed

1:

Disable cache in Silverlight HttpWebRequest
You could specify a submitHandler this will perform the form submission once validation succeeds:. How do I display the duration it took to generate a page in a pages footer?
$('form').validate({     submitHandler: function(form) {        // TODO: submit your form in ajax here     } }); 
So if you are using the jQuery.form plugin to ajaxify your form:. Additional information in ASP.Net MVC View
$('form').validate({     submitHandler: function(form) {         $(form).ajaxSubmit();             } }); 
Facebook IFrame Application issues for certain usersprogrammatically logout a “specific” user

2:

Asp.net mvc html melper
You must add action="" so it will be valid HTML, and use the type="submit" although ton without problems. Proper way to build a data Repository in ASP.NET MVCSimply catch the submit with jQuery and prevent the normal submit from occuring:.
$('#addform').submit(function() {   // your stuff here to process the form    // end with   return false; });


89 out of 100 based on 44 user ratings 799 reviews

@