diff options
-rw-r--r-- | demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page | 26 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TValidationSummary.php | 16 |
2 files changed, 25 insertions, 17 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page index 5ac143ae..b345dfcc 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page @@ -7,33 +7,33 @@ <legend>Create New Account</legend>
<div class="username">
- Username:
+ Username:
<com:TTextBox ID="Username" />
<com:TRequiredFieldValidator
ID="UsernameVal"
ControlToValidate="Username"
- Display="None"
ValidationGroup="Group1"
- ErrorMessage="a username is required." />
+ Text="*"
+ ErrorMessage="a username is required." />
</div>
<div class="password">
Password
<com:TTextBox ID="Password" TextMode="Password" />
+ <com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ ValidationGroup="Group1"
+ Text="*"
+ ErrorMessage="a password is required." />
</div>
-<com:TRequiredFieldValidator
- ID="PasswordVal"
- ControlToValidate="Password"
- Display="None"
- ValidationGroup="Group1"
- ErrorMessage="a password is required." />
-
+
<div class="create">
<com:TButton ID="Create" ValidationGroup="Group1" Text="Create New Account"/>
</div>
<div class="registrationSummary">
- <com:TValidationSummary
+ <com:TValidationSummary
ValidationGroup="Group1"
Display="None"
HeaderText="Unable to create new account because" />
@@ -48,7 +48,7 @@ <div class="username">
Login Name:
<com:TTextBox ID="UserID" />
-
+
<com:TRequiredFieldValidator
ID="UserVal1"
ControlToValidate="UserID"
@@ -71,7 +71,7 @@ <com:TButton ID="login" ValidationGroup="Group2" CssClass="button" Text="Sign In" />
<div class="validation">
- <com:TValidationSummary
+ <com:TValidationSummary
ValidationGroup="Group2"
AutoUpdate="false"
Display="None"
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index 61a4415c..41362264 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -37,6 +37,16 @@ class TValidationSummary extends TWebControl
{
/**
+ * Constructor.
+ * This method sets the foreground color to red.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setForeColor('red');
+ }
+
+ /**
* @return string the display behavior (None, Static, Dynamic) of the error message in a validation summary component.
*/
public function getDisplay()
@@ -50,9 +60,7 @@ class TValidationSummary extends TWebControl */
public function setDisplay($value)
{
- if($value!='None' && $value!='Dynamic')
- $value='Static';
- $this->setViewState('Display',$value,'Static');
+ $this->setViewState('Display',TPropertyValue::ensureEnum($value,'None','Dynamic','Static'),'Static');
}
/**
@@ -196,7 +204,7 @@ class TValidationSummary extends TWebControl if($display==='None' || $display==='Dynamic')
$writer->addStyleAttribute('display','none');
else
- $writer->addStyleAttribute('visibility','hidden');
+ $writer->addStyleAttribute('visibility','hidden');
}
$writer->addAttribute('id',$this->getClientID());
parent::addAttributesToRender($writer);
|