diff options
author | xue <> | 2006-02-07 02:38:25 +0000 |
---|---|---|
committer | xue <> | 2006-02-07 02:38:25 +0000 |
commit | 9d904fdfba3fd2925d7c121f2ec0d68a5ac18ab9 (patch) | |
tree | 5d9de300957c310d19997b75ffb91a0096b120f8 /framework/Web/UI/WebControls | |
parent | a2bb6b40fa09b9d25a610ea71854bfd06ee538cf (diff) |
Added AutoTrim property to TTextBox.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TTextBox.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 9427bb1f..5d508fd2 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -172,6 +172,8 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable public function loadPostData($key,$values)
{
$value=$values[$key];
+ if($this->getAutoTrim())
+ $value=trim($value);
if(!$this->getReadOnly() && $this->getText()!==$value)
{
$this->setText($value);
@@ -274,6 +276,23 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable }
/**
+ * @return boolean a value indicating whether the input text should be trimmed spaces. Defaults to false.
+ */
+ public function getAutoTrim()
+ {
+ return $this->getViewState('AutoTrim',false);
+ }
+
+ /**
+ * Sets the value indicating if the input text should be trimmed spaces
+ * @param boolean the value indicating if the input text should be trimmed spaces
+ */
+ public function setAutoTrim($value)
+ {
+ $this->setViewState('AutoTrim',TPropertyValue::ensureBoolean($value),false);
+ }
+
+ /**
* @return boolean whether postback event trigger by this text box will cause input validation, default is true.
*/
public function getCausesValidation()
|