summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-01-09 03:16:41 +0000
committerxue <>2006-01-09 03:16:41 +0000
commit10420d2bcde1a7437b58175f417170b2d6d93e50 (patch)
tree20cc8b7b156031a18b50d3f706de3042a6a77675
parentbe711692b0ac4d3a542f30a54d648af4dc579cfc (diff)
-rw-r--r--.gitattributes1
-rw-r--r--framework/Web/UI/WebControls/TRequiredFieldValidator.php29
2 files changed, 30 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index cf7bc17b..dd6d39c3 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -536,6 +536,7 @@ framework/Web/UI/WebControls/TPlaceHolder.php -text
framework/Web/UI/WebControls/TRadioButton.php -text
framework/Web/UI/WebControls/TRadioButtonList.php -text
framework/Web/UI/WebControls/TRepeatInfo.php -text
+framework/Web/UI/WebControls/TRequiredFieldValidator.php -text
framework/Web/UI/WebControls/TStatements.php -text
framework/Web/UI/WebControls/TStyle.php -text
framework/Web/UI/WebControls/TTable.php -text
diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
new file mode 100644
index 00000000..b30de607
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
@@ -0,0 +1,29 @@
+<?php
+
+class TRequiredFieldValidator extends TBaseValidator
+{
+ public function getInitialValue()
+ {
+ $this->getViewState('InitialValue','');
+ }
+
+ public function setInitialValue($value)
+ {
+ $this->setViewState('InitialValue',TPropertyValue::ensureString($value),'');
+ }
+
+ protected function evaluateIsValid()
+ {
+ $value=$this->getValidationValue($this->getValidationTarget());
+ return trim($value)!==trim($this->getInitialValue());
+ }
+
+ protected function getClientScriptOptions()
+ {
+ $options = parent::getClientScriptOptions();
+ $options['initialvalue']=$this->getInitialValue();
+ return $options;
+ }
+}
+
+?> \ No newline at end of file