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...

https://jqueryvalidation.org/documentation/


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -