From 67df5f61adc904798056a8281e17da7e52fcd5cb Mon Sep 17 00:00:00 2001 From: gnits Date: Sat, 12 Apr 2014 00:58:58 +0200 Subject: Recaptcha controls converted to jQuery Prototype-style calls replaced with jQuery-style calls --- framework/Web/UI/WebControls/TReCaptchaValidator.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/WebControls/TReCaptchaValidator.php') diff --git a/framework/Web/UI/WebControls/TReCaptchaValidator.php b/framework/Web/UI/WebControls/TReCaptchaValidator.php index bba356b8..e25d0f84 100644 --- a/framework/Web/UI/WebControls/TReCaptchaValidator.php +++ b/framework/Web/UI/WebControls/TReCaptchaValidator.php @@ -116,8 +116,7 @@ class TReCaptchaValidator extends TBaseValidator // this function will be used to update the validator 'function '.$fn.'(valid)', '{', - ' var v = $('.TJavaScript::quoteString($this->getClientID()).');', - ' $('.TJavaScript::quoteString($this->getClientID().'_1').').value = valid;', + ' jQuery('.TJavaScript::quoteString('#'.$this->getClientID().'_1').').val(valid);', ' Prado.Validation.validateControl('.TJavaScript::quoteString($control->ClientID).'); ', '}', '', @@ -126,9 +125,9 @@ class TReCaptchaValidator extends TBaseValidator $this->Page->IsCallback ? $fn.'('.$value.');' : '', '', // wait for the captcha to be constructed - 'Event.observe(document,"captchaready:'.$control->getClientID().'",function() { ', + 'jQuery(document).on("captchaready:'.$control->getClientID().'",function() { ', // install event handler that clears the validation error when user changes the captcha response field - 'Event.observe('.TJavaScript::quoteString($control->getResponseFieldName()).',"keyup",function() { ', + 'jQuery('.TJavaScript::quoteString('#'.$control->getResponseFieldName()).').on("keyup",function() { ', $fn.'("1");', '});', '});', -- cgit v1.2.3