summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorDavid <ottodavid@gmx.net>2015-04-06 12:37:54 +0200
committerDavid <ottodavid@gmx.net>2015-04-06 12:40:51 +0200
commit16475815a81ec42364c729b634188f2363ca13ee (patch)
tree98f6b5336ade4950a0b545eb35670450f5a56e54 /framework/Web
parent95eae21c1968cb3be2248004ee5364361cebe02d (diff)
Fix TReCaptcha Validation
It seems like captchaready is fired too soon, when recaptcha is not yet ready. Use jquery delegated events to work around this.
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/TReCaptchaValidator.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/TReCaptchaValidator.php b/framework/Web/UI/WebControls/TReCaptchaValidator.php
index e25d0f84..83bee07b 100644
--- a/framework/Web/UI/WebControls/TReCaptchaValidator.php
+++ b/framework/Web/UI/WebControls/TReCaptchaValidator.php
@@ -124,12 +124,9 @@ class TReCaptchaValidator extends TBaseValidator
// (if we're in initial rendering or a postback then the result will be rendered directly to the page html anyway)
$this->Page->IsCallback ? $fn.'('.$value.');' : '',
'',
- // wait for the captcha to be constructed
- 'jQuery(document).on("captchaready:'.$control->getClientID().'",function() { ',
- // install event handler that clears the validation error when user changes the captcha response field
- 'jQuery('.TJavaScript::quoteString('#'.$control->getResponseFieldName()).').on("keyup",function() { ',
- $fn.'("1");',
- '});',
+ // install event handler that clears the validation error when user changes the captcha response field
+ 'jQuery("#'.$control->getClientID().'").on("keyup", '.TJavaScript::quoteString('#'.$control->getResponseFieldName()).', function() { ',
+ $fn.'("1");',
'});',
)));
}