GOGETMUSCLE Community Sending form with ajax recaptcha

Sending form with ajax recaptcha

Hello,

Is it possible to send a form via ajax when the form also has a recaptcha?


$.ajax({
type: ‘POST’,
url: ‘https://api.hsforms.com/submissions/v3/integration/submit/******/******-*****-*****’,
data: JSON.stringify(data),
dataType: ‘json’,
contentType: ‘application/json’,
success: function(_data) {
console.log(‘HubSpot submission success’, _data);
},
error: function(xhr, status, error) {
console.error(‘HubSpot submission failed’);
console.error(‘Status:’, status);
console.error(‘Error:’, error);
console.error(‘Response text:’, xhr.responseText);
}
});


This code works without Recaptcha but when enabling it on this form it will give me the error that recaptcha is not correct.

Is there a way to send the recaptcha token in this ajax post?

Leave a Reply

Your email address will not be published.

Related Post