I can’t fathom what’s causing this error, I’ve tried everything I can think of to fix it. I have two different submit buttons, designed to fire some Ajax and post data, on my page. One works and fires perfectly. The second never POSTs anything.
Can anyone see where I might have gone wrong?
$('.delete').submit( function(event) {
event.preventDefault();
$(this).children('input[type=\"submit\"]').prop('disabled',true);
alert("Click detected!");
$.ajax({
url: 'scripts/deleteWork.php',
data: slideID,
type: 'POST',
mode: 'abort',
success: function(){
$('#newOrder-1').fadeOut('fast');
},
error: function(){
$(this).children('input[type=\"submit\"]').prop('disabled',false);
}
});
return false;
});
I’ve tried removing the first occurrence, in case it was causing the problem by clashing somehow. I’ve checked and re-checked my syntax. The alert fires fine… just no sign of a POST in Firebug. I don’t understand it!
Thanks for any help.
*smacks forehead*
I needed to add the following line:
Thanks Aaron W. and thecodeparadox.