Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In one text Box i m entered a from date 11-07-1984
in another text box i want validation as more than 1 year gap. how to do?
Posted

Hi,
In the focus out event of textbox2 check the dates with your condition.
regards,
shefeek
 
Share this answer
 
I think you need to write your own client side and server side code to compare dates in both the textboxes.

BTW you should be using Calendar control instead of textboxes.
 
Share this answer
 
Use the TImeSpan class to add a year to the date and then validate against this calculated date in the new text box.
 
Share this answer
 
v2
also you can use javascript if your program is web base,
get value of first text box and then sum 1 year and calculate this, if less than that you can stop it and alert for this error. good luck :D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900