showing results for - "how to call the ajax when form is valid"
Sarah
18 Jun 2016
1$('#form').validate({
2
3    ... your validation rules come here,
4
5    submitHandler: function(form) {
6        $.ajax({
7            url: form.action,
8            type: form.method,
9            data: $(form).serialize(),
10            success: function(response) {
11                $('#answers').html(response);
12            }            
13        });
14    }
15});
Yoann
20 Aug 2018
1BY LOVE,
21- $("form").valid() is the main method which is checking the form is valid or not
32- 'btnsave' is the ID of the HTML BUTTON  element.
43- Jquery pluggin should be added in this order
5	<script src="~/Scripts/jquery-1.7.1.min.js"></script>
6    <script src="~/Scripts/jquery.validate.js"></script>
7    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
8
9$('#btnSave').click(function () {
10        if ($("form").valid()) {
11            //alert('FORM VALID');
12            $.ajax({
13                url: 'http://localhost:3932/api/EmployeeService/Save',
14                type: 'POST',
15                dataType: 'json',
16                success: function () {
17                    alert('Employee Save successfully');
18                },
19                error: function (xhr, textStatus, errorThrown) {
20                    alert('Error occured');
21                }
22            });
23        }
24    });
queries leading to this page
after jquery form validation user pass on next responsehow to use jquery validation in ajaxvalidate form data before ajax callform to submit it data via ajax and validateajax validation functionjquery validate form before submit with ajaxjavascript form validation ajaxjquery form validation example on ajax calljquery form validation before ajax submitform validation jquery ajax get example jquery ajax form submit with validationajax validation submithandler ajaxphp form validation with ajax and jqueryajax form submit after jquery validationjquery validation for ajax submit forms exampleajax form validation before submitjquery validate on ajax added formformvalidation ajax submitvalid input using ajaxinput ajax form validateajax validation jsjquery form ajax validationvalidate form in ajaxjquery validation ajax form sendjquery v alidation ajax form submitjquery validation in ajax formvalidate ajax formon form submit validation jqueryjavascript check form before submit with ajaxajex all field validationjavascript ajax submit form on validationjquery form validate and ajax submitif form is valid ajaxajax validation on submithow to validate form before ajax submitformvalidation on submit ajaxhow to call ajax on form validusing ajax for form validationjquery ajax post validation dataajax form validation javascriptajax html form validatephp ajax form validationajax for form validationjquery 2b ajax form validationjquery validation ajax submit exampleform validate on submit with ajaxhow to perform validation when the user types the data in ajaxform submit ajax after validationform validation using ajax javascriptjquery form validation ajaxjquery validate form submit ajaxjquery validate submit form ajaxusing ajax form validation how to validate a form in javascript ajaxjquery validate submithandler ajaxajax validation formajax form validaitonafter checking then form submit in ajax jqueryjquery validation with ajaxvalidate form before ajax submitjquey validate and submit form using jquery ajaxjquery ajax form validation ajax submit with jquery validationjquery validate form before ajax submitphp ajax form submit with validationjquery validation with ajax submithow to validate a form using jquery ajax jquery validate and ajax submithit ajax after validate min js form submit with ajax call validation fireajax validate code then allow submitform validation using jquery plugin examples ajax submit demoajaxform validate input fieldsjquery ajax validate formform ajax validation jquery codeform js validation and ajax submitajax validationjavascript ajax validation before submitjquery form validation with ajaxhow to use ajax in form validationvalidation form ajaxsubmit ajax form validation jqueryvalidate form before submit ajaxjquery validation on ajax submitjquery submit form ajax after validationjquery validate form data submit ajaxjs forma validation with ajax posthow to allow types in ajax jquery validationajax jquery validatejquery contact form 7 ajax callback validatejquery form validation on submit for ajax callsjquery validate form put eith ajaxjquery validate send ajax form exampleajax name validationjquery validate is success then only ajax submitjquery submit call validate functionjquery validate form put with ajaxhow to do validation before ajaxformcheck required fields before ajax submitjquery validate ajax submitform validation using ajax jquery javascriptjquery validation ajaxhow to ajax call when form validhow can i show form validation messages in ajax jquerysimple ajax form validationform submit jquery validation using ajax contact form with validation and ajax submitform validation using ajax 3c javascript form submit function in jqueryjquery validation submit ajax formajax form submit with validationjquery ajax form submit and validationjquery form validation ajax submitajax and jquery form validationajax form validationjquery validator for ajax fromhow to validate form using ajaxphp ajax submit form after validationhow to write validation in ajax request javascriptajax call on form validphp ajax form submit with jquery validationjquery validation submit handler ajaxjquery ajax validationjquery form validator ajax submitjquery validation for ajax submit formsajax validation in form jquery form validation in ajaxjquery ajax form validation trigger jquery validation functionajax form submit with jquery validationjquery validation form submitsubmit form when jquery ajax successvalidation in ajaxform validation ajaxvalidate input jquery ajax postjavascript ajax form validation on submitvalidate and submit form using jquerysend form via ajax with validationhow to add validation in ajax jquery validator plugin 2b ajax submitting not workingajax check formajax textbox validationjquery validation ajax form datajquery validation submit form ajaxjquery form validation submit handler ajaxajax jquery validation submit handlerjquery ajax check form before submithow to validate form with ajaxvalidate jquery ajax submitajax post form validationajax jquery form validationjquery form validation and submit using ajaxform ajax validationjquery ajax validation before submitphp submit validation ajaxform submit in jquery validationverify required before ajavalidate before ajax form jqueryjquery steps ajax validationajax validate formform validate ajax jqueryjavascript input form validation ajax requestform validation jquery ajaxadd ajax to form validationajax validation form jquery validate submit ajaxvalidate form ajaxajax validate form before submitjquery with ajax form validationajax submit form after validationhow to validate the field before ajax callajax form submit validationform generated by ajax validationjquery form validation with ajax submitajax validatejquery validate form with ajaxvalidate html form using ajaxvalidate ajax form before submitform validation using ajax and jqueryjquery validate and send form ajaxhow to call the ajax when form is validcheck submit form from ajax or actionjquery form validation in php ajax submitjquery validation and ajax submit formsubmit handler in ajax validationjquery form validation true only form submit in ajaxajax form validation jqueryjquery validate with ajaxa submithow to use ajax javascript to do form validationjquery on form valid ajax callvalidation using ajaxform submit using ajax login validateform validation with ajaxform validation in ajax jqueryhtml form ajax validationgrav form submit jquery ajax exampleform validation using ajaxjquery validate ajax formajax call after jquery validate formwhat is form validation in ajaxvalidation event handling and form submit and response in ajax jqueryvalidate and submit form using jquery ajaxajax form validationform validation with jquery ajaxform validation in ajax with jsonform submit in jquery ajax validationajax for submit cheack required fieldhow to check form using jquery before ajaxvalidating forms with ajaxjquery validate submit form ajax callajax jquery validationajax form submission and jquery validatevalidation data in jquery before sending ajax requestfirst validate the form using jquery and then if success then call ajaxhow to call the ajax when form is valid