Using minDate and maxDate option with datepicker on Form.

Hi All,

I'm trying to add a datepicker that restricts the valid dates to be entered for a user's DOB. Here's my js to add the functionality.

    changeYear: true,
    showAnim: 'fadeIn',
    minDate: "-22Y",
    maxDate: "-15Y",
    dateFormat: "dd M yy",
    changeMonth: true

However, when I use the form/helper to build the form the date restrictions don't work. I think it has something to do with the js added by the helper when constructing the datepicker form field, but I'm not sure.

Anyone else come up against this problem, and do you have a solution.


View Replies:
gogza replied on at Permalink Reply
OK I managed to do what I wanted!

By overriding the date-time form helper at:


Overriding helpers is a little more complicated than other c5 objects, see for a great explanation.

I removed the js embedded in the html for the date-time attribute - meaning I could add my own jquery datepickers instead of the default one. Ta da!

HTH someone,