Dates are common items of data, and it is important that the user be able to easily input a date into your web form. Typically, you would use a date picker that has date validation included to provide an easy input method. This recipe shows you how to manually validate a date in the UK format (that is, DD/MM/YYYY
). Date pickers are covered in Chapter 9, jQuery UI, using the popular jQuery UI framework. Refer to the See also section of this recipe for more information.
Continuing the trend of the previous recipes of this chapter, ensure that you have validation.js
open and ready for modification and that you have completed the previous three recipes.