You are here

function recipe_validate in Recipe 7.2

Same name and namespace in other branches
  1. 5 recipe.module \recipe_validate()
  2. 6 recipe.module \recipe_validate()
  3. 7 recipe.module \recipe_validate()

Implements hook_validate().

Errors should be signaled with form_set_error().

File

./recipe.module, line 1141
Contains functions for Recipe node CRUD and display.

Code

function recipe_validate($node, $form, &$form_state) {
  $return = TRUE;
  if (!is_numeric($form_state['values']['recipe_yield']) || $form_state['values']['recipe_yield'] <= 0) {
    form_set_error('recipe_yield', t('Yield must be a valid positive integer.'));
    $return = FALSE;
  }
  return $return;
}