public function onPreRender($param)
{
parent::onPreRender($param);
$cs = $this->Page->getClientScript();
$cs->registerPradoScript('validator');
// communicate validation status to the client side
$value = $this->_isvalid === false ? '0' : '1';
$cs->registerHiddenField($this->getClientID() . '_1', $value);
// update validator display
if ($control = $this->getValidationTarget()) {
$fn = 'captchaUpdateValidatorStatus_' . $this->getClientID();
$cs->registerEndScript($this->getClientID() . '::validate', implode(' ', array('function ' . $fn . '(valid)', '{', ' jQuery(' . TJavaScript::quoteString('#' . $this->getClientID() . '_1') . ').val(valid);', ' Prado.Validation.validateControl(' . TJavaScript::quoteString($control->ClientID) . '); ', '}', '', $this->Page->IsCallback ? $fn . '(' . $value . ');' : '', '', 'jQuery("#' . $control->getClientID() . '").on("change", ' . TJavaScript::quoteString('#' . $control->getResponseFieldName()) . ', function() { ', $fn . '("1");', '});')));
}
}