Advertisement
yuvarajupadhyaya

form serialize

Aug 19th, 2022
765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.08 KB | Source Code | 0 0
  1. function SaveGroup() {
  2.         var groupId = $('#GroupId').val();
  3.         var status = $('#Status').val();
  4.            var form = $("#settingform-country");
  5.            if (form.valid()) {
  6.                 $.ajax({
  7.                     url: '@Url.Action("CountryCreate", "Setting")',
  8.                     dataType: "json",
  9.                     data: form.serialize(),
  10.                     type:"post",
  11.                     success: function (result) {
  12.                         if (result && result.success) {
  13.                             $("#countryModal").modal("hide")
  14.                             location.reload(true);
  15.                         } else {
  16.                             $('#settingform-country [data-valmsg-for="CountryCode"]').addClass("field-validation-valid")
  17.                             $('#settingform-country [data-valmsg-for="CountryCode"]').addClass("field-validation-error")
  18.                             $('#settingform-country [data-valmsg-for="CountryCode"]').text(result.msg)
  19.                         }
  20.                     }
  21.  
  22.  
  23.  
  24.            });
  25.            }
  26.        }\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement