How to validate form using AJAX Json -
`function savedetails() { // var frmdata = $('#frmsavedetails').serializeobject(); var form = $("#frmsavedetails"); var frmdata = serializeobject("frmsavedetails");`
$.ajax("/home/savedetails", { type: 'post', data: frmdata, async: true, success: function (result) { if (!result.success) { //what write here? }
} }, error: function () { //alert('an error occurred, please try again.'); } }); }
how return json response , show error in form respective controls .i want no alert msgs. please ..thank u in advance
you can use jquery ajax in different way using library https://jqueryvalidation.org/ here multiple validation related syntax validation handling.
for more detail study go page...
Comments
Post a Comment