I've been figuring out how to integrate ReCaptcha, ASP.NET, and Gaia Ajax. It was a bit of a challenge to use the ReCaptcha AJAX APIs with Gaia to fetch the data from the recaptcha_response_field
text box in an AJAX postback through a patch.
This was just a brief overview. Now, I want to apply another patch to ReCaptcha without having to start from scratch (an extensive open source library that enhances the current ASP.NET implementation would be ideal, but unfortunately I don't have the time for that): check out this question for more details.
Essentially,
After using ReCaptcha.Create()
to display the CAPTCHA in an AJAX postback, I need to attach to the OnKeyDown event of the recaptcha_response_field and insert a JavaScript snippet that prevents the form from being submitted.
Since I can't control the rendering of the <input>
tag, I have to handle it externally.
In essence,
I believe you could perhaps address the broader question: "how can JavaScript event handlers be set programmatically?" as this concept is applicable to various event classes.
Many thanks