date_validate

Definition

date_validate($form)
includes/form.inc, line 867

Description

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

Related topics

Namesort iconDescription
Form generationFunctions to enable output of HTML forms and form elements.

Code

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.