Submit Form With Ajax And Jquery Validation June 22, 2024 Post a Comment I have form. There are two inputs:name and birthday. My code is: Solution 1: Try using the below code instead of ajaxSubmit:$.ajax({ type: "GET", url: "addEmpl.php", data: $(this).serialize(), dataType: "html"success: function(data) { $("#block").html(data); } }); CopyHope it will help you :)Solution 2: You can write like this: $().ready(function() { $("#addForm").validate({ rules:{ name:{ required: true, minlength: 2, maxlength: 10, }, }, highlight: function (element) { $(element).closest('.form-group').addClass('has-error'); }, messages:{ name:{ required: "This field is required", minlength: "Name must be at least 2 characters", maxlength: "Maximum number of characters - 10", }, }, submitHandler: function(form) { $.ajax({ url:'addEmpl.php', type:'GET', dataType: 'html', success: function(data) { $("#block").html(data); } }); returnfalse; // required to block normal submit since you used ajax } }); }); CopyHere is the fiddle http://jsfiddle.net/bhumi/bvdu94c4/Baca JugaI Need Jqgrid To Refresh The Entire Page, Not Just The GridGetting The Count Of Unique Values For Elements With Regex In DatatableJqgrid.info_dialog Is Not A Function, Do I Have To Call Extend?Solution 3: You can try this <script> $('#submit').click(function (){ //your code here }); </script>Copy Share You may like these postsWhat Is The Problem With This Ajax(with Prototype)?Xss Attacks PreventionDynamic Row Values Wrongly Updated Into Mysql PhpHow To Convert Php Regex To Match Arabic Characters To Js Regex Post a Comment for "Submit Form With Ajax And Jquery Validation"
Post a Comment for "Submit Form With Ajax And Jquery Validation"