You are here

function recipe_validate in Recipe 6

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

Implementation of hook_validate().

Errors should be signaled with form_set_error().

File

./recipe.module, line 1212
recipe.module - share recipes

Code

function recipe_validate($node, &$form) {
  if (!is_numeric($node->yield) || $node->yield <= 0) {
    form_set_error('yield', t('Yield must be a valid positive integer.'));
  }
}