[development] Skipping validation on date field

Randy Fay randy at randyfay.com
Thu Mar 17 16:38:04 UTC 2011


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




-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110317/5ad9c2c7/attachment.html 


More information about the development mailing list