function finder_form_validate in Finder 6
Same name and namespace in other branches
- 7.2 includes/form.inc \finder_form_validate()
- 7 includes/finder.form.inc \finder_form_validate()
Validate function for finder form.
Implements the 'validate_empty' functionality.
See also
1 string reference to 'finder_form_validate'
- finder_form in includes/
finder.form.inc - FAPI definition for the finder form.
File
- includes/
finder.form.inc, line 151 - The finder form.
Code
function finder_form_validate($form, &$form_state) {
$finder_id = $form_state['values']['finder_id'];
$finder = finder_load($finder_id);
if ($finder->settings['advanced']['validate_empty']) {
$all_empty = TRUE;
foreach ($finder->elements as $finder_element) {
if (!empty($form_state['values'][$finder_element->finder_element_id])) {
$all_empty = FALSE;
break;
}
}
if ($all_empty) {
form_set_error('form', t('Please complete the %finder form.', array(
'%finder' => $finder->title,
)));
}
}
}