I have following jQuery ajax code to check data exists before post to give user warning message if user want to update or abort update,
jQuery in beforeSend works, but I read data always zero and I want to know any property to set to let jQuery to abort the update when user does not want to continue.
Your help and information is great appreciated,
Regards,
Iccsi,
jQuery.ajax({ url: "MyServer.cfc?method=MyMethod="+jQuery("#Mylst").val(),
type: "POST",
beforeSend: function( xhr ) {
jQuery.ajax({
url: "MyCheck.cfc?method=cxcCheckCXCExist&cEmployeeID="+jQuery("#MyLst").val(),
type: "GET",
success: function(data)
{
alert(data[0]);
alert( $("#MyLst option:selected" ).text() + " for " +
Data exists do you want to continue?");
}
})
});