views:

18

answers:

1

Hello,

We are developing an application where we have a Form to fill by users. Here is the scenario for some fields:

  1. Name : Does not contain numbers like 123 but it can be alpha-numeric like mynangal123 but does not contain special characters
  2. DOB : Does contain specific formats like mm.dd.yyyy or dd/mm/yyy or yyyy/mm/dd etc. doesn't contain alphabets
  3. TAXID : Can be Numeric but not numbers like it can be "123" but not 123 also it can be T-125

Now, as per requirement we have to validate or prompt the user for specific input if he/she did not enter the specific entry. Like if in name User enter 123456 then there should be a messagebox to warn "please enter a valid name"

Restrictions : We have a option of Javascript but its not recommendable in most of scenario so, we need to create a custom validators or something else which will solve our problem.

Please provide some feasible solution for the issue.

Thanks in advance.

+1  A: 

Use Custom Validators for this. They provide support for server side & client side validation.

Barry
@Barry - Custom-validators are not enough as per requirements.
Rick
@Gaurav - Can you explain this? You can write custom code to validate the controls which may include regular expressions. They can either be executed client side i.e when the control loses focus or server side through a post back?
Barry
@Barry - Thanks, I used [url href="http://livevalidation.com/"]livevalidations[/url]
Rick