Magento Registration – Date of Birth in One Field

dateregister

I want that in my customer regitration form date of birth field to be in one field. Now it's in 3 fields.
So I have

<div class="input-box customer-dob">
    <input type="text" id="<?php echo $this->getFieldId('dob') ?>" name="<?php echo $this->getFieldName('dob') ?>"
           class="input-text validation-custom required-entry"/>
</div>

But validation don't working. Have you any idea?

Best Answer

In your code, instead of validate-custom provide validate-date as the class for the input field.

The validation script for this can be found in js/prototype/validation.js line 503

'validate-date', 'Please enter a valid date.', function(v) {
                var test = new Date(v);
                return Validation.get('IsEmpty').test(v) || !isNaN(test);
            }],