I\'m looking to implement validation for a mobile site, where I have two input fields and I would like the first to validate the value is no later than todays date, and the
You can use a Regex pattern like this /([0-9]{2})/([0-9]{2})/([0-9]{4})/
, that is, two decimal digits, a slash, two more decimal digits, a slash and four decimal digits, everything grouped separately (group 1 = day, group 2 = month, group 3 = year). You would test for this pattern in a event, (I would suggest onchange
, since you mentioned mobile) and also check if the numbers are within a valid range (e.g. day < 32, month < 13, year < currentYear-1).