function date_validate

7.x date_validate($element)
5.x date_validate($form)
6.x date_validate($element)

Validates the date type to prevent invalid dates (e.g., February 30, 2006).

Related topics

1 string reference to 'date_validate'
system_element_info in drupal/modules/system/system.module
Implements hook_element_info().


drupal/includes/, line 3048
Functions for form and batch generation and processing.


function date_validate($element) {
  if (!checkdate($element['#value']['month'], $element['#value']['day'], $element['#value']['year'])) {
    form_error($element, t('The specified date is invalid.'));