From 5bd4f1f34bb08469d3e18727f9d39c53037c6424 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 28 Oct 2006 07:43:27 +0000 Subject: Add TActiveCustomValidator to change ErrorMessage on callbback. --- .../Web/UI/ActiveControls/TActiveCustomValidator.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'framework/Web/UI/ActiveControls/TActiveCustomValidator.php') diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php index a0ef895c..1668b54f 100644 --- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php +++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php @@ -124,6 +124,21 @@ class TActiveCustomValidator extends TCustomValidator return $options; } + /** + * Sets the text for the error message. Updates client-side erorr message. + * @param string the error message + */ + public function setErrorMessage($value) + { + parent::setErrorMessage($value); + if($this->getActiveControl()->canUpdateClientSide()) + { + $client = $this->getPage()->getCallbackClient(); + $func = 'Prado.Validation.setErrorMessage'; + $client->callClientFunction($func, array($this, $value)); + } + } + /** * Register the javascript for the active custom validator. */ -- cgit v1.2.3