From 0261efc8fd547ddcbba77de6bc7e8fb170b1ae59 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 13 Oct 2004 17:08:50 +0000 Subject: - Patch #11531 by killes: it was not possible to deselect all choices of a form_checkboxes array. --- includes/common.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index d35a10d87..066e1840a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1266,14 +1266,14 @@ function form_checkbox($title, $name, $value = 1, $checked = FALSE, $description */ function form_checkboxes($title, $name, $values, $options, $description = NULL, $attributes = NULL, $required = FALSE) { if (count($options) > 0) { - if (!isset($values)) { + if (!isset($values) || $values == 0) { $values = array(); } $choices = ''; foreach ($options as $key => $choice) { $choices .= '
'; } - return theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); + return form_hidden($name, 0) . theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); } } -- cgit v1.2.3