[development] Skipping validation on date field
Jeff Hartman
lists at jeffhartman.com
Thu Mar 17 16:40:08 UTC 2011
Sorry. Drupal 6.
On Mar 17, 2011, at 11:38 AM, Randy Fay wrote:
> Hi Jeff, and everybody: When you post a question like this, please say what version of Drupal you're talking about. The D7 answer to this question is a fair bit different from the D6 answer.
>
> -Randy
>
> On Thu, Mar 17, 2011 at 9:53 AM, Jeff Hartman <lists at jeffhartman.com> wrote:
> I have a birthdate date field in a form where I am using #after_build to modify. The modifications to the drop down values are:
> - add a "select month", "select day", and "select year" options to their respective drop downs
> - change the range of years in the year drop down
>
> This field(s) is not required. However, if I don't select anything in the drop downs and leave each on the "select month/day/year" values, Drupal validation tells me that the selected date is not valid.
>
> How can I tell Drupal to skip this validation? Even if I try to validate this field in hook_form_validate it still tells me the data is invalid.
>
> Jeff
More information about the development
mailing list