fixed not working checkboxes after r31472

This commit is contained in:
Ralf Becker 2010-07-22 13:13:55 +00:00
parent bad2477f30
commit a8826ad635

View File

@ -2207,12 +2207,12 @@ class etemplate extends boetemplate
self::set_array($content,$form_name,$value); self::set_array($content,$form_name,$value);
break; break;
case 'checkbox': case 'checkbox':
if (!$value) if (!$value && $attr['needed'])
{
if ($attr['needed'])
{ {
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),''); self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
} }
if ($value === false)
{
self::set_array($content,$form_name,$attr['multiple'] ? array() : $attr['unset_value']); // need to be reported too self::set_array($content,$form_name,$attr['multiple'] ? array() : $attr['unset_value']); // need to be reported too
} }
else else