Why are you using e.preventDefault(); in the start of click event. Remember
e.preventDefault();
always prevents the browser to stop executing the below lines of a specific event.
Change the code to:
$("#submit-btn").on("click",function(e) {
$.ajax({
url: "https://ivr.callxl.com/callXLWeb/SendingEmail",
type: "POST",
contentType: "application/json; charset=utf-8",
data: "comment="+$("#cmessage").val() ,
dataType: "text",
success: function (data, textStatus, jqXHR) {
if (data.success) {
alert("successfully sent");
} else {
}
},
error: function(jqXHR, textStatus, errorThrown){
alert(jqXHR.responseText);
alert("error in server");
console.log("Something really bad happened " + textStatus);
$("#errorResponse").html(jqXHR.responseText);
}
});
e.preventDefault();
});