diff options
author | wei <> | 2006-04-27 08:39:55 +0000 |
---|---|---|
committer | wei <> | 2006-04-27 08:39:55 +0000 |
commit | 4aa1f46fcb508271b09cb5736d8bd0ef7206941d (patch) | |
tree | 09bc3e09d94e7cd768e904eaab14e523255af3a1 /tests | |
parent | b387c4ae04ed2854dab5cd608468a95d3d49721c (diff) |
Added client-side events to client-side validators. see tests/FunctionalTests/features/index.php?page=ValidatorEffects
Diffstat (limited to 'tests')
-rw-r--r-- | tests/FunctionalTests/features/protected/controls/Layout.tpl | 5 | ||||
-rw-r--r-- | tests/FunctionalTests/features/protected/pages/ValidatorEffects.page | 91 |
2 files changed, 96 insertions, 0 deletions
diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl index 18482377..66b42f6c 100644 --- a/tests/FunctionalTests/features/protected/controls/Layout.tpl +++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl @@ -16,6 +16,11 @@ margin-top: 2em;
display: block;
}
+ .required
+ {
+ border:1px solid red;
+ background-color: #fdd;
+ }
/*]]>*/
</style>
</com:THead>
diff --git a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page new file mode 100644 index 00000000..47d99969 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page @@ -0,0 +1,91 @@ +<com:TContent ID="Content">
+
+<h1>Validator Visual Effects Test</h1>
+<fieldset id="quickRegistration">
+ <legend>Create New Account</legend>
+
+<com:TClientScript UsingPradoScripts="effects" />
+
+<div class="username">
+ Username:
+ <com:TTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="UsernameVal"
+ ControlToValidate="Username"
+ ValidationGroup="registration"
+ ControlCssClass="required"
+ Display="Dynamic"
+ ErrorMessage="a username is required.">
+ <prop:ClientValidation.OnError>
+ Effect.Shake(validator.control);
+ Effect.Appear(validator.message);
+ </prop:ClientValidation.OnError>
+ <prop:ClientValidation.OnSuccess>
+ Effect.Fade(validator.message);
+ </prop:ClientValidation.OnSuccess>
+ </com:TRequiredFieldValidator>
+</div>
+<div class="password">
+ Password
+ <com:TTextBox ID="Password" TextMode="Password" />
+ <!-- alternate synatx : see
+ http://encytemedia.com/blog/articles/2006/03/07/prototype-gets-some-serious-syntactic-sugar
+ -->
+<com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ ValidationGroup="registration"
+ ControlCssClass="required"
+ Display="Dynamic"
+ ClientValidation.OnError="validator.message.visualEffect('appear')"
+ ClientValidation.OnSuccess="validator.message.visualEffect('fade')"
+ ErrorMessage="a password is required." />
+</div>
+<div class="create">
+ <com:TButton ID="Create" ValidationGroup="registration" Text="Create New Account"/>
+</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="signin"
+ 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="signin"
+ ErrorMessage="the password was not provided" />
+</div>
+
+
+<com:TButton ID="login" ValidationGroup="signin" CssClass="button" Text="Sign In" />
+
+<div class="validation">
+ <com:TValidationSummary
+ ID="summary2"
+ ValidationGroup="signin"
+ AutoUpdate="false"
+ HeaderText="<p>You could not login because</p>" />
+</div>
+
+</fieldset>
+
+
+</com:TContent>
\ No newline at end of file |