You are here

function date_validate in Drupal 4

Same name and namespace in other branches
  1. 5 includes/form.inc \date_validate()
  2. 6 includes/form.inc \date_validate()
  3. 7 includes/form.inc \date_validate()

Validates the FAPI date type to stop dates like 30/Feb/2006

Related topics

File

includes/form.inc, line 867

Code

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