More info:
Modified ajaxSubmit in contactForm in functions.js. Added error and complete handler as follows:
$(form).ajaxSubmit({
target: elementResult,
dataType: 'json',
//beforeSend: function(data) {
// alert(data.toSource());
//},
error: function(data) {
alert("error");
},
complete: function() {
alert("complete");
},
success: function( data ) {
if( elementLoader == 'button' ) {
defButton.html( defButtonText );
} else {
$(form).find('.form-process').fadeOut();
}
if( data.alert != 'error' && elementRedirect ){
window.location.replace( elementRedirect );
return true;
}
if( elementAlert == 'inline' ) {
if( data.alert == 'error' ) {
var alertType = 'alert-danger';
} else {
var alertType = 'alert-success';
}
elementResult.removeClass( 'alert-danger alert-success' ).addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 );
} else {
elementResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html('');
SEMICOLON.widget.notifications( elementResult );
}
if( $(form).find('.g-recaptcha').children('div').length > 0 ) { grecaptcha.reset(); }
if( data.alert != 'error' ) { $(form).clearForm(); }
}
});
I'm seeing error callback called, and then complete callback called, but not success callback. If I examine 'data' argument in error callback, I seeing what looks like a valid response from sendmail.php, including valid json response:
data
Object = $1
abort: function(a)
always: function()
complete: function()
done: function()
error: function()
fail: function()
getAllResponseHeaders: function()
getResponseHeader: function(a)
overrideMimeType: function(a)
pipe: function()
progress: function()
promise: function(a)
readyState: 4
responseText: "form posted{ \"alert\": \"success\", \"message\": \"We have **successfully** received your Message and will get Back to you as soo…"
setRequestHeader: function(a,b)
state: function()
status: 200
statusCode: function(a)
statusText: "OK"
success: function()
then: function()
Email is sent, response is received in error callback, but not getting success callback hit. Any guidance is appreciated any more at this point!