diff options
author | wei <> | 2006-02-18 23:41:16 +0000 |
---|---|---|
committer | wei <> | 2006-02-18 23:41:16 +0000 |
commit | 270282e3a26b21184a2051995cb5b9a2755b823d (patch) | |
tree | 761d82ad761996f329d63acc770fc5a0bce9d5a2 /demos/quickstart | |
parent | f1cc3c880b564362e7f00b18326e116884879231 (diff) |
Update some javascript code.
Diffstat (limited to 'demos/quickstart')
5 files changed, 100 insertions, 32 deletions
diff --git a/demos/quickstart/protected/pages/Advanced/I18N.page b/demos/quickstart/protected/pages/Advanced/I18N.page index 1bb5a9a0..db97c25c 100644 --- a/demos/quickstart/protected/pages/Advanced/I18N.page +++ b/demos/quickstart/protected/pages/Advanced/I18N.page @@ -134,6 +134,9 @@ $message = localize("There are {num_users} users online.", array('num_users'=>$n <p>Where the second parameter in <tt>localize</tt> takes an associative array with the key as the substitution to find in the text and replaced it with the associated value.
The <tt>localize</tt> function does not solve the problem of localizing languages that have plural forms, the solution is to use <a href="#choice-format">TChoiceFormat</a>.</p>
+<p>The following sample demonstrates the basics of localization in Prado.</p>
+<com:RunBar PagePath="Advanced.Samples.I18N.Home" />
+
<h1>I18N Components</h1>
<a name="ttranslate"></a>
<h2>TTranslate</h2>
@@ -225,4 +228,5 @@ is "One Apple". If the <tt>Value</tt> was "2", then it will show "Two Apples".</ <p>Any non-empty combinations of the delimiters of square and round brackets are acceptable.
The string chosen for display depends on the <tt>Value</tt> property. The <tt>Value</tt> is evaluated for each set until the <tt>Value</tt> is found to belong to a particular set.</p>
+
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.page index 7abed86a..ab99436a 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.page @@ -1,6 +1,8 @@ <com:TContent ID="body">
<h1>TCompareValidator Samples</h1>
+<p><strong>Note:</strong>TCompareValidator will start
+to validate only if both inputs are not empty.</p>
<table class="sampletable">
@@ -9,8 +11,8 @@ Compare validator with default settings:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox1" />
-<com:TTextBox ID="TextBox11" />
+<com:TTextBox ID="TextBox1" Text="a1" />
+<com:TTextBox ID="TextBox11" Text="a2"/>
<com:TCompareValidator
ValidationGroup="Group1"
ControlToValidate="TextBox1"
@@ -25,8 +27,8 @@ Compare validator with default settings: Compare validator with client-side validation disabled:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox2" />
-<com:TTextBox ID="TextBox22" />
+<com:TTextBox ID="TextBox2" Text="b1"/>
+<com:TTextBox ID="TextBox22" Text="b2" />
<com:TCompareValidator
ValidationGroup="Group2"
EnableClientScript="false"
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page index bbeef3fd..db63a0a9 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page @@ -1,6 +1,8 @@ <com:TContent ID="body">
<h1>TEmailAddressValidator Samples</h1>
+<p><strong>Note:</strong>TEmailAddressValidator will start
+to validate only if the input is not empty.</p>
<table class="sampletable">
@@ -9,7 +11,7 @@ Email address validator with default settings:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox1" />
+<com:TTextBox ID="TextBox1" Text="a"/>
<com:TEmailAddressValidator
ValidationGroup="Group1"
ControlToValidate="TextBox1"
@@ -23,7 +25,7 @@ Email address validator with default settings: Email address validator with client-side validation disabled:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox2" />
+<com:TTextBox ID="TextBox2" Text="b"/>
<com:TEmailAddressValidator
ValidationGroup="Group2"
EnableClientScript="false"
@@ -38,7 +40,7 @@ Email address validator with client-side validation disabled: Email address validator with focus-on-error enabled and dynamic display:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox3" />
+<com:TTextBox ID="TextBox3" Text="c"/>
<com:TEmailAddressValidator
ValidationGroup="Group3"
ControlToValidate="TextBox3"
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page index ac93715d..5ce43fda 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page @@ -1,7 +1,8 @@ <com:TContent ID="body">
<h1>TRegularExpressionValidator Samples</h1>
-
+<p><strong>Note:</strong>TRegularExpressionValidator will start
+to validate only if the input is not empty.</p>
<table class="sampletable">
<tr>
@@ -9,12 +10,12 @@ Regular expression validator with default settings:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox1" />
+<com:TTextBox ID="TextBox1" Text="a"/>
<com:TRegularExpressionValidator
ValidationGroup="Group1"
ControlToValidate="TextBox1"
- RegularExpression="\w+"
- Text="Only word characters are allowed." />
+ RegularExpression="\d+"
+ Text="Only digits are allowed." />
<com:TButton Text="Submit" ValidationGroup="Group1" />
</td>
</tr>
@@ -24,13 +25,13 @@ Regular expression validator with default settings: Regular expression validator with client-side validation disabled:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox2" />
+<com:TTextBox ID="TextBox2" Text="b"/>
<com:TRegularExpressionValidator
ValidationGroup="Group2"
EnableClientScript="false"
ControlToValidate="TextBox2"
- RegularExpression="\w+"
- Text="Only word characters are allowed." />
+ RegularExpression="\d+"
+ Text="Only digits are allowed." />
<com:TButton Text="Submit" ValidationGroup="Group2" />
</td>
</tr>
@@ -40,13 +41,13 @@ Regular expression validator with client-side validation disabled: Regular expression validator with focus-on-error enabled and dynamic display:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox3" />
+<com:TTextBox ID="TextBox3" Text="c"/>
<com:TRegularExpressionValidator
ValidationGroup="Group3"
ControlToValidate="TextBox3"
Display="Dynamic"
- RegularExpression="\w+"
- Text="Only word characters are allowed." />
+ RegularExpression="\d+"
+ Text="Only digits are allowed." />
<com:TButton Text="Submit" ValidationGroup="Group3" />
</td>
</tr>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page index 75ca9c52..5ac143ae 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TValidationSummary/Home.page @@ -2,24 +2,83 @@ <h1>TValidationSummary Samples</h1>
-<table class="sampletable">
-
-<tr>
-<td class="samplenote">
-Required field validator with default settings:
-</td>
-<td class="sampleaction">
-<com:TValidationSummary ValidationGroup="Group1" />
-<com:TTextBox ID="TextBox1" />
+
+<fieldset id="quickRegistration">
+ <legend>Create New Account</legend>
+
+<div class="username">
+ Username:
+ <com:TTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="UsernameVal"
+ ControlToValidate="Username"
+ Display="None"
+ ValidationGroup="Group1"
+ ErrorMessage="a username is required." />
+</div>
+<div class="password">
+ Password
+ <com:TTextBox ID="Password" TextMode="Password" />
+</div>
<com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ Display="None"
ValidationGroup="Group1"
- ControlToValidate="TextBox1"
- Text="Field required." />
-<com:TButton Text="Submit" ValidationGroup="Group1" />
-</td>
-</tr>
+ ErrorMessage="a password is required." />
+
+<div class="create">
+ <com:TButton ID="Create" ValidationGroup="Group1" Text="Create New Account"/>
+</div>
+
+
+<div class="registrationSummary">
+ <com:TValidationSummary
+ ValidationGroup="Group1"
+ Display="None"
+ HeaderText="Unable to create new account because" />
+</div>
+
+</fieldset>
+
+
+<fieldset id="LoginForm">
+ <legend>Sign In</legend>
+
+<div class="username">
+ Login Name:
+ <com:TTextBox ID="UserID" />
+
+ <com:TRequiredFieldValidator
+ ID="UserVal1"
+ ControlToValidate="UserID"
+ Display="None"
+ ValidationGroup="Group2"
+ ErrorMessage="the username or email was not provided" />
+</div>
+
+<div class="password" >
+ Password:
+ <com:TTextBox ID="Pass" TextMode="Password" />
+ <com:TRequiredFieldValidator
+ ID="loginValidator3"
+ ControlToValidate="Pass"
+ Display="None"
+ ValidationGroup="Group2"
+ ErrorMessage="the password was not provided" />
+</div>
+
+<com:TButton ID="login" ValidationGroup="Group2" CssClass="button" Text="Sign In" />
+<div class="validation">
+ <com:TValidationSummary
+ ValidationGroup="Group2"
+ AutoUpdate="false"
+ Display="None"
+ ShowMessageBox="true"
+ HeaderText="You could not login because" />
+</div>
-</table>
+</fieldset>
</com:TContent>
\ No newline at end of file |