How do I verify in jQuery that a date entered on a input text box or value in html such as mm/dd/yyyy is not greater than todays date. Example would be “5/5/2011” would pass as true b/c its not greater than today “6/17/2011”, but “5/5/3011” would be greater than today and should return false. Is there a simple function that can return true or false if a date in form “mm/dd/yyyy” is greater than todays date in javascript or jQuery?
Share
Just convert to a
Dateobject and compare your date value toDate.now– for example:You do not actually need to use jQuery for this at all, pure JavaScript is good enough. Please have a look at the docs for Javascript
Datefor more information.