}
}
-// handleCheckboxes - unmarks and disables the "Totals only" checkbox when
+// handleCheckboxes - unmarks and hides the "Totals only" checkbox when
// "no grouping" is selected in the associated dropdown.
-// In future we need to improve this function and hide not relevant elements completely.
function handleCheckboxes() {
var totalsOnlyCheckbox = document.getElementById("chtotalsonly");
+ var totalsOnlyLabel = document.getElementById("totals_only_label");
if ("no_grouping" == document.getElementById("group_by").value) {
// Unmark and disable the "Totals only" checkbox.
totalsOnlyCheckbox.checked = false;
- totalsOnlyCheckbox.disabled = true;
- } else
- totalsOnlyCheckbox.disabled = false;
+ totalsOnlyCheckbox.style.visibility = "hidden";
+ totalsOnlyLabel.style.visibility = "hidden";
+ } else {
+ totalsOnlyCheckbox.style.visibility = "visible";
+ totalsOnlyLabel.style.visibility = "visible";
+ }
}
</script>
<td>{$forms.reportForm.group_by3.control}</td>
</tr>
<tr>
- <td><label>{$forms.reportForm.chtotalsonly.control} {$i18n.label.totals_only}</label></td>
+ <td><span id="totals_only_label"><label>{$forms.reportForm.chtotalsonly.control} {$i18n.label.totals_only}</label></span></td>
</tr>
</table>
$group_by_options_size = sizeof($group_by_options);
$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by','data'=>$group_by_options));
if (defined('MULTIPLE_GROUP_BY_DEBUG') && isTrue(MULTIPLE_GROUP_BY_DEBUG)) {
- if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by2','data'=>$group_by_options));
- if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by3','data'=>$group_by_options));
+ if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','name'=>'group_by2','data'=>$group_by_options));
+ if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','name'=>'group_by3','data'=>$group_by_options));
}
$form->addInput(array('type'=>'checkbox','name'=>'chtotalsonly'));