I need to use javascript and it should be able to validate it including leap year. Example : "The function I used above can't work.".

Clean it up, fix unclosed tags, remove the least interesting parts (customer id, recipient name...), then try to ask yourself where the problem(s) should be located.

validating a leap year-81validating a leap year-1validating a leap year-13

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

I have 3 drop downs one for month one for year and one for date.

They are all loaded with the values on the page (I have hard coded them for all 3 drop downs).

Read Line()); //User values for date and month Console.

If s is the string representation of a leap day in a non-leap year in the current culture's current calendar, the parse operation fails and the method returns false. Write Line("Please enter a date."); string date String = Console. Try Parse(date String, out date Value)) { // Hooray, your input was recognized as having a valid date format, // and is a valid date!

The problem I am having is if the user selects say April, then the month drop down still shows date 31st.

Also for February, it still shows 29th, 30th, 31st. Also the other problem would arise is how to handle the leap year? Please help There are a bunch of other ways too, to determine the number of days in a month; you can put together a small method that will calculate this for you. NET that you could easily convert to C#: Determine Number of days in any month given a date: Code.asp? NET to C# In your case if they select 'April' you could just pass in 4/1/09 (or whatever year applicable), and the number of days in the month would be returned.

date Value now contains the parsed date // as a Date Time.