From 75b8e1b8d659ccbbb644c0d28c642eacc0ffb955 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 28 Nov 2008 10:42:02 +0000 Subject: Improved checkbox value retention git-svn-id: https://code.elgg.org/elgg/trunk@2494 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/input/checkboxes.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'views/default/input') diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 2b9970aaa..da53bf271 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -19,18 +19,20 @@ */ $class = $vars['class']; - if (!$class) $class = "input-checkboxes"; - + if (!$class) $class = "input-checkboxes"; + foreach($vars['options'] as $label => $option) { //if (!in_array($option,$vars['value'])) { if (is_array($vars['value'])) { - if (!in_array($option,$vars['value'])) { + $valarray = $vars['value']; + $valarray = array_map('strtolower', $valarray); + if (!in_array(strtolower($option),$valarray)) { $selected = ""; } else { $selected = "checked = \"checked\""; } } else { - if ($option != $vars['value']) { + if (strtolower($option) != strtolower($vars['value'])) { $selected = ""; } else { $selected = "checked = \"checked\""; -- cgit v1.2.3