function date_validate

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

Validates the date type to stop dates like February 30, 2006.

Related topics

1 string reference to 'date_validate'
system_elements in drupal-6.x/modules/system/system.module
Implementation of hook_elements().

File

drupal-6.x/includes/form.inc, line 1734

Code

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