diff --git a/includes/form.inc b/includes/form.inc index 710a6f9218e05fcc6f788377679fd04db26e3044..742d23a1f79511ddf54e05f1af911a29b4c0572a 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -153,8 +153,8 @@ function _form_validate($elements, $form_id = NULL) { form_error($elements, t('%name field is required.', array('%name' => $elements['#title']))); } - // Add legal choice check if element has #options. - if (isset($elements['#options']) && isset($elements['#value'])) { + // Add legal choice check if element has #options. Can be skipped, but then you must validate your own element. + if (isset($elements['#options']) && isset($elements['#value']) && !isset($elements['#DANGEROUS_SKIP_CHECK'])) { $message = t('Illegal choice in %title.', array('%title' => theme('placeholder', $elements['#title']))); if ($elements['#type'] == 'select') { $options = form_options_flatten($elements['#options']);