$.ajax({
url: "./form/formprocessor.php",
type: 'POST',
data: payload,
dataType: 'json',
crossDomain: true,
success: function(done) {
data.success = done.success;
data.captchaError = done.captchaError;
afterSubmit(data);
},
error: function() {
afterSubmit(data);
}
});
}
echo '{
"success" : true,
"CaptchaError" : false
}';