MDL-5696 fixed 'Checkbox' actually allows 'checkboxes' and empty 'options' (radio buttons too)

This commit is contained in:
skodak
2006-12-13 09:53:59 +00:00
parent 76a2fd8251
commit 6c31d376c2
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -46,6 +46,9 @@ class data_field_checkbox extends data_field_base {
$i = 0;
foreach (explode("\n", $this->field->param1) as $checkbox) {
$checkbox = trim($checkbox);
if ($checkbox === '') {
continue; // skip empty lines
}
$str .= '<input type="checkbox" id="field_'.$this->field->id.'_'.$i.'" name="field_' . $this->field->id . '[]" ';
$str .= 'value="' . s($checkbox) . '" ';
@@ -46,6 +46,9 @@ class data_field_radiobutton extends data_field_base {
$i = 0;
foreach (explode("\n",$this->field->param1) as $radio) {
$radio = trim($radio);
if ($radio === '') {
continue; // skip empty lines
}
$str .= '<input type="radio" id="field_'.$this->field->id.'_'.$i.'" name="field_' . $this->field->id . '" ';
$str .= 'value="' . s($radio) . '" ';