function filter_form_validate in Drupal 6
Same name and namespace in other branches
- 4 modules/filter.module \filter_form_validate()
- 5 modules/filter/filter.module \filter_form_validate()
Validation callback for filter elements in a form.
See also
filter_form().
Related topics
1 string reference to 'filter_form_validate'
- filter_form in modules/
filter/ filter.module - Generates a selector for choosing a format in a form.
File
- modules/
filter/ filter.module, line 538 - Framework for handling filtering of content.
Code
function filter_form_validate($form) {
foreach (element_children($form) as $key) {
if ($form[$key]['#value'] == $form[$key]['#return_value']) {
return;
}
}
form_error($form, t('An illegal choice has been detected. Please contact the site administrator.'));
watchdog('form', 'Illegal choice %choice in %name element.', array(
'%choice' => $form[$key]['#value'],
'%name' => empty($form['#title']) ? $form['#parents'][0] : $form['#title'],
), WATCHDOG_ERROR);
}