Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"Success":false,"Error":true,"ErrorType":1,"ModelErrors":{"Name":"u0027Nameu0027 must not be empty.","Owner":"u0027Owneru0027 must not be empty.","Email":"u0027Emailu0027 must not be empty.","Password":"u0027Passwordu0027 must not be empty.","Size":"Please provide a valid Number"}}
- $("form").on('submit', function () {
- var form = $('.form');
- var url = form.attr('action');
- var formData = form.serialize();
- $.ajax({
- type: 'POST',
- url: url,
- dataType: 'json',
- data: formData,
- success: function (response) {
- if (response.Success==true) {
- console.log(response.Success);
- showMsg(response.Message);
- //alert(response.Message);
- }
- //alert(data);
- },
- error: function (response) {
- console.log(response.responseText);
- if (response.responseText.Error === true)
- {
- var modelErrors = response.responseText.ModelErrors;
- console.log(modelErrors);
- console.log("Check "+modelErrors);
- }
- },
- cache: false
- });
- });
- var response = JSON.stringify(response);
- var modelErrors = response.responseText.ModelErrors;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement