Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi i am having the Date in the aspx page of text box 20/03/2012 and having the today date in one variable dmy=09/03/2013 in javascript now i want to check the text box date with today date,month,year(dmy variable)and need to return error if the text box date is past date from today date can u help me the code in javascript
Posted

1 solution

First of all, I would not recommend to use text box for date. You can better use DateTimePicker for ASP.NET:
DateTimePicker Web Control[^].

Everything else is here: http://msdn.microsoft.com/en-us/library/system.datetime.aspx[^].

Perhaps, you may need only one hint: for comparison, you can simply use the operators '==', '!=', '>=', '<=', '>', and '<'.

—SA
 
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