Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
63
rated 0 times [  69] [ 6]  / answers: 1 / hits: 13481  / 9 Years ago, tue, june 23, 2015, 12:00:00

I implement the reCAPTCHA in this tutorial,



https://codeforgeek.com/2014/12/google-recaptcha-tutorial/



which work well for the first time submit. The problems I have are:




  1. I send the captcha with other form data e.g. username , email etc.... so if captcha is correct but other not , the user will send it again, but the second time it return { success: false }


  2. if I idle it for ~2 min , it will session expire and if I select the box it pop up alert and warning something like can not refresh : invalid parameter, and I can not select the box again




How to fix those problem? Thanks a lot.


More From » php

 Answers
1

Google reCAPTCHA gives these two functions: I always use this in all my AJAX powered forms.



grecaptcha.getResponse()


grecaptcha.reset();



For both of your problems, use the second function whenever you need in your JavaScript code.



Remember this works if you have only one CAPTCHA in your page. If you have more than two CAPTCHAs use their IDs as explained in Google Docs



https://developers.google.com/recaptcha/docs/display#js_api


[#36164] Monday, June 22, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mollys

Total Points: 183
Total Questions: 95
Total Answers: 85

Location: Vanuatu
Member since Fri, May 13, 2022
2 Years ago
;