From 145c4aef09e278d29bfd8e9858e114ca097e5901 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 18 Feb 2006 07:24:51 +0000 Subject: client script reorganization. --- framework/Web/UI/WebControls/TBaseValidator.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/WebControls/TBaseValidator.php') diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 97ba1a8b..46f031ca 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -156,7 +156,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $scriptKey = "TBaseValidator:$formID"; if($this->getEnableClientScript() && !$scripts->isEndScriptRegistered($scriptKey)) { - $scripts->registerClientScript('validator'); + $scripts->registerPradoScript('validator'); $scripts->registerEndScript($scriptKey, "Prado.Validation.AddForm('$formID');"); } if($this->getEnableClientScript()) @@ -194,8 +194,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $class = get_class($this); $scriptKey = "prado:".$this->getClientID(); $scripts = $this->getPage()->getClientScript(); - $serializer = new TJavascriptSerializer($this->getClientScriptOptions()); - $options = $serializer->toJavascript(); + $options = TJavaScript::encode($this->getClientScriptOptions()); $js = "new Prado.Validation(Prado.Validation.{$class}, {$options});"; $scripts->registerEndScript($scriptKey, $js); } -- cgit v1.2.3