{"id":1783,"date":"2025-11-05T14:39:00","date_gmt":"2025-11-05T15:39:00","guid":{"rendered":"http:\/\/gogetmuscle.com\/?p=1783"},"modified":"2025-11-05T17:37:53","modified_gmt":"2025-11-05T17:37:53","slug":"sending-form-with-ajax-recaptcha","status":"publish","type":"post","link":"http:\/\/gogetmuscle.com\/index.php\/2025\/11\/05\/sending-form-with-ajax-recaptcha\/","title":{"rendered":"Sending form with ajax recaptcha"},"content":{"rendered":"
Hello,
Is it possible to send a form via ajax when the form also has a recaptcha?
<\/P>
\n $.ajax({
\n type: ‘POST’,
\n url: ‘https:\/\/api.hsforms.com\/submissions\/v3\/integration\/submit\/******\/******-*****-*****’,
\n data: JSON.stringify(data),
\n dataType: ‘json’,
\n contentType: ‘application\/json’,
\n success: function(_data) {
\n console.log(‘HubSpot submission success’, _data);
\n },
\n error: function(xhr, status, error) {
\n console.error(‘HubSpot submission failed’);
\n console.error(‘Status:’, status);
\n console.error(‘Error:’, error);
\n console.error(‘Response text:’, xhr.responseText);
\n }
\n });
\n
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?
<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"
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 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1783"}],"collection":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/comments?post=1783"}],"version-history":[{"count":1,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1783\/revisions"}],"predecessor-version":[{"id":1784,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1783\/revisions\/1784"}],"wp:attachment":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/media?parent=1783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/categories?post=1783"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/tags?post=1783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}