date_validate

5 form.inc date_validate($form)
6 form.inc date_validate($element)
7 form.inc date_validate($element)
8 form.inc date_validate($element)

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

Related topics

1 string reference to 'date_validate'

File

includes/form.inc, line 2955
Functions for form and batch generation and processing.

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.'));
  }
}
Login or register to post comments