From 4baf17880e3c83b6900794459d2ebb9adf379aa3 Mon Sep 17 00:00:00 2001 From: "haertl.mike" <> Date: Wed, 29 Oct 2008 19:47:02 +0000 Subject: Fixed issue #13 (trac #813) --- .../UI/WebControls/TRegularExpressionValidator.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TRegularExpressionValidator.php') diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php index 125416f3..be861e45 100644 --- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php +++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php @@ -96,7 +96,7 @@ class TRegularExpressionValidator extends TBaseValidator } /** - * @param string pattern modifiers, + * @param string pattern modifiers for server side validation, * see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php */ public function setPatternModifiers($value) @@ -112,6 +112,23 @@ class TRegularExpressionValidator extends TBaseValidator return $this->getViewState('PatternModifiers', ''); } + /** + * @param string pattern modifiers for clientside. + * (Only 'g','i' and 'm' are available.) + */ + public function setClientSidePatternModifiers($value) + { + $this->setViewState('ClientSidePatternModifiers', $value); + } + + /** + * @return string clientside pattern modifiers, no modifiers by default. + */ + public function getClientSidePatternModifiers() + { + return $this->getViewState('ClientSidePatternModifiers', ''); + } + /** * Returns an array of javascript validator options. * @return array javascript validator options. @@ -120,6 +137,7 @@ class TRegularExpressionValidator extends TBaseValidator { $options = parent::getClientScriptOptions(); $options['ValidationExpression']=$this->getRegularExpression(); + $options['PatternModifiers']=$this->getClientSidePatternModifiers(); return $options; } } -- cgit v1.2.3