Google ReCaptcha Implementation

Google came out with their new ReCaptcha feature the other day so I implemented it and its working GREAT.
https://developers.google.com/recaptcha/

Feel free to include it in your projects.
Here’s a sample project with it included
https://www.dropbox.com/s/g8x84mqeiq1j7z2/WebControlLibrary-2014-12-04.zip?dl=0

Drag it in like any other custom control, set the SiteKey and SecretKey properties, and then implement the Verified event.

Should be great! I was looking at something like this some time ago. I’ll give it a spin tomorrow!
Thanks, Brock! :slight_smile:

[quote=148133:@Brock Nash]Google came out with their new ReCaptcha feature the other day so I implemented it and its working GREAT.
https://developers.google.com/recaptcha/

Feel free to include it in your projects.
Here’s a sample project with it included
https://www.dropbox.com/s/g8x84mqeiq1j7z2/WebControlLibrary-2014-12-04.zip?dl=0

Drag it in like any other custom control, set the SiteKey and SecretKey properties, and then implement the Verified event.[/quote]

I just saw that on Tech News this morning. Thank you Brock :slight_smile:

I’d love to get any feedback. The control is crazy simple to use but there’s a few minor features I could still add to it. The “dark” theme is one of those for example.

hmm, can’t use it in 2013r33.
I get a Syntax error: WebReCaptcha.FrameworkPropertyChanged.

Guess I need to upgrade soon :stuck_out_tongue:

Thanks Brock to share it.

It works perfectly :slight_smile:

[quote=148282:@Albin Kiland]hmm, can’t use it in 2013r33.
I get a Syntax error: WebReCaptcha.FrameworkPropertyChanged.

Guess I need to upgrade soon :P[/quote]

Yeah the WebSDK didn’t have the HTMLHeader Hook event back in 2013 which this control uses. And apparently the FrameworkPropertyChanged event didn’t exist yet either

It works great though when I try in the latest version!
Kudos!

It works alright, but if I go to another page, then back to the page with the recaptcha control, I get a js error:

Could not execute returned javascript: ReCAPTCHA placeholder element must be empty Source: grecaptcha.render('QCr6nITF', { 'sitekey' : '6Ld_xv4SAAAAALuIg6cTR-Wn3Zb4dnF3vPkBbp3I' , 'callback' : function(callback){Xojo.triggerServerEvent('QCr6nITF','Verify',[callback])} });

[quote=148934:@Jay Madren]It works alright, but if I go to another page, then back to the page with the recaptcha control, I get a js error:

Could not execute returned javascript: ReCAPTCHA placeholder element must be empty Source: grecaptcha.render('QCr6nITF', { 'sitekey' : '6Ld_xv4SAAAAALuIg6cTR-Wn3Zb4dnF3vPkBbp3I' , 'callback' : function(callback){Xojo.triggerServerEvent('QCr6nITF','Verify',[callback])} });[/quote]

Hmmm I call the reCaptcha’s render JS event in the Xojo shown event. Do you mean your navigating from one WebPage to another within the Xojo app or within the browser? It must fail if the shown event is called a second time, and I was thinking I could rely on this being called once.

Yes, navigating back to the page within the app (user clicks a menu button, page is shown). Open is called once, Shown is called every time the page (and therefore control) is… um… shown.

UPDATE
https://www.dropbox.com/s/5fs42iygzkry7po/WebControlLibrary-2014-12-08.zip?dl=0

I added the “dark” theme and made it so it doesn’t throw a javascript error when “shown” an additional time.

[quote=149296:@Brock Nash]UPDATE
https://www.dropbox.com/s/5fs42iygzkry7po/WebControlLibrary-2014-12-08.zip?dl=0

I added the “dark” theme and made it so it doesn’t throw a javascript error when “shown” an additional time.[/quote]
Thanks. Works great!

[quote=149296:@Brock Nash]UPDATE
https://www.dropbox.com/s/5fs42iygzkry7po/WebControlLibrary-2014-12-08.zip?dl=0

I added the “dark” theme and made it so it doesn’t throw a javascript error when “shown” an additional time.[/quote]

Thank you !

Hi Guys!

Just last night, I try to UPLOAD this program on my own IIS server using my own RECAPTCHA key.

But it doesn’t work when uploaded to host but its function if run on my IDE.

Here is the link of the uploaded file [quote]http://xojo.pentagamma.net/10/webcontrollibrary.cgi[/quote]

Anybody had success on this?

[quote=149296:@Brock Nash]UPDATE
https://www.dropbox.com/s/5fs42iygzkry7po/WebControlLibrary-2014-12-08.zip?dl=0

I added the “dark” theme and made it so it doesn’t throw a javascript error when “shown” an additional time.[/quote]

Hi Brock,

I ran your sample webapp, but maybe the keys are not valid for a test?

about Google, do you know if any kind of use is free, after registering the site?

Thank You

[quote=416828:@Giacomo Bernardi]about Google, do you know if any kind of use is free, after registering the site?
[/quote]

Yes registration and use of your own keys is free

thank you.
how can I test your project, using the included keys?

Thanks Brock to share…
Is it possible to change the image and get it in Spanish ?
I’m not a robot = No soy un robot