Featured On ...

asp.net

totalasp.co.uk

fuzzysoftware.com

devdex.com

123aspx.com

dotnetfreaks.com

411asp.net

and more ...

ASP.NET Validation Package Demo 4 - Multiple validation groups within an ASP.NET server form

The following demo contains three non server forms, each independently being validated. The first form collects basic user information from a subscriber and contains a series of validation rules as follows:

  • The name, street, town, and country cannot be left blank.
  • The date of birth is optional, but the person subscribing must be older than 18. The field accepts either a US date format (MM/DD/YYYY) or a format that could not be considered to be ambiguous.
  • The email address must be a valid email address and cannot be left blank.

The second form is a login form (it doesn't actually log into anything). It contains two basic validation rules as follows:

  • Both the username and password must adhere to the regular expression ^[a-z][a-z0-9-_.]{4,19}$

The login form is used later to demonstrate server-side only validation.

The third form is a basic search form that contains two search term fields and a condition. The validation rules for this form are a little more complex than the others. The rules follow:

  • The first search term is required.
  • If a condition is selected, the second search term must not be blank.
  • If no condition is selected, the second search term must be blank.

>> Show me the page code!

>> Show me the code for the subscribe form control!

>> Show me the code for the login form control!

>> Show me the code for the search form control!

>> Turn off client side validation!




Subscribe
Name
Street
Town
Country
Date of birth
Email

Login
Username
Password

Search
Search term 1
 
Search term 2

© 2002 - 2008 Copyright, Disclaimer and Privacy Statement