Validating Date of birth in Magento

Validating Date of birth in Magento

Sometimes you may need date of birth field on customer registration page. By default magento don’t provide validation class for date of birth.
Below code achieves validation for date of birth using built-in Magento form validator.

Html Code (Below codes needs to be put in template file)

Javascript Code

You need to put this code in validation.js. You can find validation.js at “magento_root/js/prototype”

(Visited 148 times, 1 visits today)