summaryrefslogtreecommitdiffstats
path: root/template/en/default/reports/series-common.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/reports/series-common.html.tmpl')
-rw-r--r--template/en/default/reports/series-common.html.tmpl7
1 files changed, 5 insertions, 2 deletions
diff --git a/template/en/default/reports/series-common.html.tmpl b/template/en/default/reports/series-common.html.tmpl
index e10edd9e4..06b6af870 100644
--- a/template/en/default/reports/series-common.html.tmpl
+++ b/template/en/default/reports/series-common.html.tmpl
@@ -30,7 +30,7 @@
[% subcategory = category.${default.category} %]
[% name = subcategory.${default.subcategory} %]
-<script>
+<script type="text/javascript">
[%# This structure holds details of the series the user can select from. %]
var series = {
[% FOREACH c = category.keys.sort %]
@@ -102,7 +102,8 @@ function checkNewState() {
<label for="[% sel.name %]" accesskey="[% sel.accesskey %]">
<select name="[% sel.name %]" id="[% sel.name %]"
size="[% sel.size %]" style="width: 15em"
- [%+ "onchange='$sel.onchange'" IF sel.onchange %]>
+ [%+ "disabled=\"disabled\"" UNLESS ${sel.name}.keys.size || newtext %]
+ [%+ "onchange=\"$sel.onchange\"" IF sel.onchange %]>
[% FOREACH x = ${sel.name}.keys.sort %]
<option value="[% x FILTER html %]"
[% " selected" IF default.${sel.name} == x %]>
@@ -110,6 +111,8 @@ function checkNewState() {
[% END %]
[% IF newtext %]
<option value="">[% newtext FILTER html %]</option>
+ [% ELSIF NOT ${sel.name}.keys.size %]
+ <option value="" disabled="disabled"></option>
[% END %]
</select>
</label>