fix unchecked-checkbox value passed to API

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-22 11:34:40 +01:00
parent 332e29be24
commit c1875132ef

View File

@@ -283,7 +283,12 @@ class htmlform
}
}
}
$output .= '<label><input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>'.$key.'</label>';
$output .= '<label>';
if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />';
}
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>';
$output .= $key.'</label>';
}
return $output;