diff --git a/includes/form_bak.inc b/includes/form.inc index df1b2f7..1f8ce9e 100644 --- a/includes/form_bak.inc +++ b/includes/form.inc @@ -1268,8 +1268,13 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { $value = in_array($elements['#type'], array('checkboxes', 'tableselect')) ? array_keys($elements['#value']) : $elements['#value']; foreach ($value as $v) { if (!isset($options[$v])) { - form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.')); - watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); + if ($elements['#type'] != 'radios') { + form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.')); + watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); + } + else { + form_error($elements, $t('You must choose exactly one radio button.')); + } } } }