summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TRegularExpressionValidator.php
diff options
context:
space:
mode:
authorchristophe.boulain <>2008-12-03 14:22:03 +0000
committerchristophe.boulain <>2008-12-03 14:22:03 +0000
commit6228873cf9d6471463d2413e7dfd7447f759baf2 (patch)
tree496a0e658330c39d4caa35602ba9f783b6f24f9c /framework/Web/UI/WebControls/TRegularExpressionValidator.php
parente8f239fea7351b248302a593a8e5eaa2a88c3e80 (diff)
Merge from trunk
Diffstat (limited to 'framework/Web/UI/WebControls/TRegularExpressionValidator.php')
-rw-r--r--framework/Web/UI/WebControls/TRegularExpressionValidator.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
index f0c645a4..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)
@@ -113,6 +113,23 @@ class TRegularExpressionValidator extends TBaseValidator
}
/**
+ * @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,8 +137,8 @@ class TRegularExpressionValidator extends TBaseValidator
{
$options = parent::getClientScriptOptions();
$options['ValidationExpression']=$this->getRegularExpression();
+ $options['PatternModifiers']=$this->getClientSidePatternModifiers();
return $options;
}
}
-?>