From 635cf5eb6df3ba4028e55b2df91f5e1ba3832758 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Thu, 2 Feb 2006 01:35:32 +0000 Subject: - #39179: Allow skipping of option validation for selects --- includes/form.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/form.inc b/includes/form.inc index 710a6f921..742d23a1f 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']); -- cgit v1.2.3