From 0226f8f5f430d34b3cead40c4eb7b458933d16c6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 18 Jan 2006 04:20:26 +0000 Subject: update javascript library and usage in web controls --- framework/Web/UI/WebControls/TBaseValidator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 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 e3fc8b2f..9c4dd1be 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -159,7 +159,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $scriptKey = "TBaseValidator"; if($this->getEnableClientScript() && !$scripts->isEndScriptRegistered($scriptKey)) { - $scripts->registerPradoScript('validator'); + $scripts->registerClientScript('validator'); $formID=$this->getPage()->getForm()->getClientID(); $js = "Prado.Validation.AddForm('$formID');"; $scripts->registerEndScript($scriptKey, $js); @@ -179,7 +179,8 @@ abstract class TBaseValidator extends TLabel implements IValidator $class = get_class($this); $scriptKey = "prado:".$this->getClientID(); $scripts = $this->getPage()->getClientScript(); - $options = TJavascript::toList($this->getClientScriptOptions()); + $serializer = new TJavascriptSerializer($this->getClientScriptOptions()); + $options = $serializer->toJavascript(); $js = "new Prado.Validation(Prado.Validation.{$class}, {$options});"; $scripts->registerEndScript($scriptKey, $js); } -- cgit v1.2.3