Hello,
I looked at the documentation for jQuery Form as well as safecracker but I can’t seem to get the success callback function to fire. I was able to get the simple function to fire like so…
$('#updatePageSite').ajaxForm(function(){
alert("foobar");
});
But that looks like it’ll go off no matter if it was successfull or not.
So I tried running the code provided here in the documentation using the Options object. But it just won’t work
$('#updatePageSite').ajaxForm({
dataType: 'json',
success: function(data) {
if (data.success) {
alert('You successfully added a new entry with entry_id '.data.entry_id)
} else {
alert('Failed with the following errors: '+data.errors.join(', '));
}
}
});
It never fires. I can’t figure out if this is something wrong with jQuery Form or safecracker, or something on my end.