I use one dropdownlist and 2 textboxes for enter DOB in registration page. Now,I have problem when selecting February month. I have to check the year field(the year entered by user is leap year or not) and then according this I control user the last date of February.Can anyone help me to do this?How I control user from entering the last date of february based on year? My code is following:
Date Of Birth*
onfocus="disableautocompletion(this.id);" AutoCompleteType="Disabled">
onfocus="disableautocompletion(this.id);" AutoCompleteType="Disabled">
ForeColor="Red" ControlToValidate="txtBDayYear" ValidationExpression="^[0-9]{4}$">
ErrorMessage="Enter the Date" ValidationGroup="TabGroup1" ForeColor="Red">
ErrorMessage="Enter the Year" ValidationGroup="TabGroup1" ForeColor="Red">
MinimumValue="1" MaximumValue="31" ErrorMessage="Please Enter Valid Date" ValidationGroup="TabGroup1"
ForeColor="Red">
MinimumValue="1900" MaximumValue="2013" ErrorMessage="Please Enter Valid Year"
ValidationGroup="TabGroup1" ForeColor="Red">
FilterType="Numbers" Enabled="True">
FilterType="Numbers" Enabled="True">

Kavi sujaPosted Sep 10, 2013, 8:43 AM
Jignesh and Joxin thank you for your replies.I try this. But I'm also check the date textbox based on "Month" dropdownlist and year textbox for February month. How I proceed this. Can anyone give idea to this?
Joxin StanlyPosted Sep 10, 2013, 1:57 AM
you can check whether the year is leap year or not in C# code. please have a look @ below link
http://webnetrevolution.blogspot.in/2011/05/check-if-year-is-leap-year-or-not-in-c.html
Jignesh TrivediPosted Sep 10, 2013, 1:54 AM
hi,
you can write on blur event(lost event on serverside) of year text box and in this event you can check whether enter year is leap year or not
Please refer below link
http://www.codeproject.com/Articles/21308/Is-it-Leap-Year-Using-Javascript
it has fuction that chaeck whether year is leap year or not.
base on this you can shaow message to user....
hope this will help you.