admin管理员组文章数量:1130349
I am new in WordPress. I have created a custom form in WordPress. When clicking on the submit button I want to submit form data using ajax to HubSpot. Please, anyone, help me how to complete this task.
I am new in WordPress. I have created a custom form in WordPress. When clicking on the submit button I want to submit form data using ajax to HubSpot. Please, anyone, help me how to complete this task.
Share Improve this question asked Oct 29, 2018 at 7:10 Rakesh PatidarRakesh Patidar 433 bronze badges2 Answers
Reset to default 0You can't do it easily. You can send AJAX requests only to the same server your site is on.
To send such request to another server, you'll have to use CORS (https://developer.mozilla/en-US/docs/Web/HTTP/CORS).
And I don't believe that HubSpot will allow you to set proper headers...
You won't be able to do it with AJAX alone for the reason described as above, but you could ajax to your own site and use PHP's cURL to achieve what you want.
Wordpress has an AJAX example you can follow here. All you would do is just set an on submit handler in javascript and fire the ajax request to the PHP function of which would throw that data up using cURL.
I am new in WordPress. I have created a custom form in WordPress. When clicking on the submit button I want to submit form data using ajax to HubSpot. Please, anyone, help me how to complete this task.
I am new in WordPress. I have created a custom form in WordPress. When clicking on the submit button I want to submit form data using ajax to HubSpot. Please, anyone, help me how to complete this task.
Share Improve this question asked Oct 29, 2018 at 7:10 Rakesh PatidarRakesh Patidar 433 bronze badges2 Answers
Reset to default 0You can't do it easily. You can send AJAX requests only to the same server your site is on.
To send such request to another server, you'll have to use CORS (https://developer.mozilla/en-US/docs/Web/HTTP/CORS).
And I don't believe that HubSpot will allow you to set proper headers...
You won't be able to do it with AJAX alone for the reason described as above, but you could ajax to your own site and use PHP's cURL to achieve what you want.
Wordpress has an AJAX example you can follow here. All you would do is just set an on submit handler in javascript and fire the ajax request to the PHP function of which would throw that data up using cURL.
本文标签: pluginsHow to submit custom form data using ajax to HubSpot form
版权声明:本文标题:plugins - How to submit custom form data using ajax to HubSpot form? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749224135a2335415.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论