summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page63
1 files changed, 29 insertions, 34 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
index c70e04c7..76ecb845 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
@@ -1,41 +1,36 @@
<com:TContent ID="body">
- <h1>Validator Toggle - Server and Client Side</h1>
- <com:TLabel ForControl="text1" Text="Text 1:" />
- <com:TTextBox ID="text1" />
- <com:TRequiredFieldValidator
- ID="validator1"
- ControlToValidate="text1"
- ErrorMessage="Text 1 is required" />
- <div>
- <com:TCheckBox ID="check1" Text="More..." />
- </div>
+<h1>Conditional Validation (client-side + server side)</h1>
- <com:TPanel ID="panel1" Style="display:none" >
- <com:TLabel ForControl="text2" Text="Text 2:" />
+<table class="sampletable">
+<tr>
+<td class="samplenote">
+Validator with default settings:<br />
+Check "optional" to validate both textboxes
+</td>
+<td class="sampleaction">
+ <com:TTextBox ID="text1" />
+ <com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="*"
+ ControlCssClass="required"/>
<com:TTextBox ID="text2" />
+ <com:TRequiredFieldValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ OnValidate="check_validate"
+ ErrorMessage="*"
+ ControlCssClass="required">
+ <prop:ClientSide.OnValidate>
+ sender.enabled = $('<%= $this->check1->ClientID %>').checked;
+ </prop:ClientSide.OnValidate>
- <com:TRequiredFieldValidator
- ID="validator2"
- ControlToValidate="text2"
- OnValidate="validator2_onValidate"
- OnPreRender="validate2_onPostValidate"
- ErrorMessage="Text 2 is required">
- <prop:ClientSide.OnValidate>
- sender.enabled = $("<%= $this->check1->ClientID %>").checked;
- </prop:ClientSide.OnValidate>
- </com:TRequiredFieldValidator>
+ </com:TRequiredFieldValidator>
+ <com:TCheckBox ID="check1" Text="Optional" />
+ <com:TButton ID="submit1" Text="Submit" />
+</td>
+</tr>
- </com:TPanel>
+</table>
- <com:TButton ID="button1" Text="Submit!" />
-
- <com:TClientScript>
- Event.OnLoad(function()
- {
- Event.observe("<%= $this->check1->ClientID %>", "click", function(ev)
- {
- $("<%= $this->panel1->ClientID %>").toggle();
- });
- });
- </com:TClientScript>
<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file