This call is making 2 requests at the same time but while using postman only one is generated. If any1 can help will be greatly appreciated. it was though only sending one at first but now every time 2 requests are generated. Though wile placing alert in the comment is only showing once on the screen.
If there actual URL is needed I will again edit the question and place the real value.
$(function(){
$("#form").on("submit", function(e){
this.disabled = true;
var Subject = $("input[name=Subject]").val();
var Detail = $("textarea[name=Detail]").val();
var Name = $("input[name=Name]").val();
var Email = $("input[name=Email]").val();
var Request = $( "#myselect option:selected" ).val();
var data = JSON.stringify({u_source:"sssss", u_subject:Subject,u_description:Detail,u_name:Name,u_email:Email,u_category:Request})
var settings = {
"async": true,
"crossDomain": true,
"url": "something",
"method": "POST",
"headers": {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Basic something",
"cache-control": "no-cache"
},
"processData": false,
"data": data,
"dataType": 'json'
}
$.ajax(settings).done(function (response) {
alert('Thank you, Your feedback has been recorded');
$('.overlay').hide();
form.reset();
});
$.ajax(settings).fail(function (response) {
alert('Sorry, Something went wrong. Please try again');
$('.overlay').hide();
form.reset();
});
e.preventDefault();
});
});
sorry if I had made a silly mistake, please help me to sort that out