/    Sign up×
Community /Pin to ProfileBookmark

How to implement googles reCAPTCHA into a web form using PHP and JS

Hi all, So what I am trying to do is integrate googles reCAPTCHA on to a web form, first thing I should mention is that this web form is created automatically by our CRM software(customer relation management software) and also this form is created with validation of the fields. In the form attributes, the “onsubmit” event is set to call a javascript function and after all fields are validated it will submit the form to the CRMs database.

My question is how would I interrupt that “onsubmit” event or implement it in such a way that it also checks the reCATPCHA is valid or not and as well as the required fields, and if both are okay, submit the form?

I have posted links to the source code(am new here and dont know how to post code on this post yet ?)

web form by CRM software – [URL=”https://gist.github.com/saadq12/e6fd1e94d4d3aca45fe3951f0e8a0ac5″]https://gist.github.com/saadq12/e6fd1e94d4d3aca45fe3951f0e8a0ac5[/URL]

PHP code for reCAPTCHA validation – [URL=”https://gist.github.com/saadq12/a8c596ab1db8a98319be153a70aa43ff”]https://gist.github.com/saadq12/a8c596ab1db8a98319be153a70aa43ff[/URL]

please let me know if you guys have any tips/suggestions/feedback or maybe I am doing something wrong, I am a novice web developer (as if it didn’t show already) thank you!

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @saadq12 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...