aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-08-06 16:57:45 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-08-06 16:57:45 +0200
commit6f616e1306bf385d0f8e1190c1a02aa957e1ca89 (patch)
treebd5b4fe20163584e2e9faf1369d22685989945e3 /template/en/default
parenta2ae154592af0131e13f935802839679e4e88924 (diff)
downloadbugs-6f616e1306bf385d0f8e1190c1a02aa957e1ca89.tar
bugs-6f616e1306bf385d0f8e1190c1a02aa957e1ca89.tar.gz
bugs-6f616e1306bf385d0f8e1190c1a02aa957e1ca89.tar.bz2
bugs-6f616e1306bf385d0f8e1190c1a02aa957e1ca89.tar.xz
bugs-6f616e1306bf385d0f8e1190c1a02aa957e1ca89.zip
Bug 1183398: Mandatory custom fields block form submission if they are hidden and have no value
r=gerv a=dkl
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/bug/field.html.tmpl30
-rw-r--r--template/en/default/global/textarea.html.tmpl4
2 files changed, 21 insertions, 13 deletions
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index f1ddf633f..21e2c72d4 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -43,13 +43,17 @@
value="[% value FILTER html %]" size="40"
maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]"
[% IF field.type == constants.FIELD_TYPE_INTEGER %] pattern="\d+[% IF dontchange %]|[% dontchange FILTER html %][% END %]" [% END %]
- [% ' aria-required="true" required' IF field.is_mandatory %]>
+ [% IF field.is_mandatory %]
+ data-required="true" [% 'aria-required="true" required' UNLESS field_hidden %]
+ [% END %]>
[% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %]
[% size = (field.type == constants.FIELD_TYPE_DATE) ? 10 : 20 %]
<input name="[% field.name FILTER html %]" size="[% size FILTER none %]"
id="[% field.name FILTER html %]"
value="[% value FILTER html %]"
- [% ' aria-required="true" required' IF field.is_mandatory %]
+ [% IF field.is_mandatory %]
+ data-required="true" [% 'aria-required="true" required' UNLESS field_hidden %]
+ [% END %]
onchange="updateCalendarFromField(this)">
<button type="button" class="calendar_button"
id="button_calendar_[% field.name FILTER html %]"
@@ -67,8 +71,9 @@
<span id="[% field.name FILTER html %]_input_area">
<input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]"
value="[% value FILTER html %]" size="7"
- [% ' aria-required="true" required' IF field.is_mandatory %]>
-
+ [% IF field.is_mandatory %]
+ data-required="true" [% 'aria-required="true" required' UNLESS field_hidden %]
+ [% END %]>
</span>
[% IF value %]
@@ -90,14 +95,15 @@
<select id="[% field.name FILTER html %]"
name="[% field.name FILTER html %]"
[% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %]
- [% SET field_size = 5 %]
- [% IF field.legal_values.size < 5 %]
- [% SET field_size = field.legal_values.size %]
- [% END %]
- size="[% field_size FILTER html %]" multiple="multiple"
- [% ' aria-required="true" required' IF field.is_mandatory %]
- [% END %]
- >
+ [% SET field_size = 5 %]
+ [% IF field.legal_values.size < 5 %]
+ [% SET field_size = field.legal_values.size %]
+ [% END %]
+ size="[% field_size FILTER html %]" multiple="multiple"
+ [% IF field.is_mandatory %]
+ data-required="true" [% 'aria-required="true" required' UNLESS field_hidden %]
+ [% END %]
+ [% END %]>
[% IF allow_dont_change %]
<option value="[% dontchange FILTER html %]"
[% ' selected="selected"' IF value == dontchange %]>
diff --git a/template/en/default/global/textarea.html.tmpl b/template/en/default/global/textarea.html.tmpl
index f3e23dd3f..313329579 100644
--- a/template/en/default/global/textarea.html.tmpl
+++ b/template/en/default/global/textarea.html.tmpl
@@ -27,6 +27,8 @@
# defaultcontent: (optional) Default content for the textarea.
# mandatory: (optional) Boolean specifying whether or not the textarea
# is mandatory.
+ # field_hidden: (optional) True if the field is hidden. Only useful if
+ # the field is mandatory.
#%]
<textarea [% IF name %]name="[% name FILTER html %]"[% END %]
@@ -46,7 +48,7 @@
onFocus="this.rows=[% maxrows FILTER html %]"
[% END %]
[% IF mandatory %]
- aria-required="true" required
+ data-required="true" [% 'aria-required="true" required' UNLESS field_hidden %]
[% END %]
[% IF onchange %]
onchange="[% onchange FILTER html %]"