Commit 165689a7 authored by Sunil Joshi's avatar Sunil Joshi Committed by Frédéric Buclin

Bug 962812: Use the "required" attribute where appropriate

r=LpSolit a=justdave
parent d9cd4707
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
</th> </th>
<td> <td>
<input size="35" id="Bugzilla_login" name="Bugzilla_login" <input size="35" id="Bugzilla_login" name="Bugzilla_login"
[%- ' type="email"' UNLESS Param('emailsuffix') %] autofocus> [%- ' type="email"' UNLESS Param('emailsuffix') %] autofocus required>
[% Param('emailsuffix') FILTER html %] [% Param('emailsuffix') FILTER html %]
</td> </td>
</tr> </tr>
<tr> <tr>
<th><label for="Bugzilla_password">Password:</label></th> <th><label for="Bugzilla_password">Password:</label></th>
<td> <td>
<input type="password" size="35" id="Bugzilla_password" name="Bugzilla_password"> <input type="password" size="35" id="Bugzilla_password" name="Bugzilla_password" required>
</td> </td>
</tr> </tr>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
If you have an account, but have forgotten your password, If you have an account, but have forgotten your password,
enter your login name below and submit a request enter your login name below and submit a request
to change your password.<br> to change your password.<br>
<input size="35" name="loginname"> <input size="35" name="loginname" required>
<input type="hidden" id="token" name="token" value="[% issue_hash_token(['reqpw']) FILTER html %]"> <input type="hidden" id="token" name="token" value="[% issue_hash_token(['reqpw']) FILTER html %]">
<input type="submit" id="request" value="Reset Password"> <input type="submit" id="request" value="Reset Password">
</form> </form>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
[% END %] [% END %]
</span> </span>
<input size="35" id="login" name="login" autofocus <input size="35" id="login" name="login" autofocus
[%- ' type="email"' UNLESS Param('emailsuffix') %]> [%- ' type="email"' UNLESS Param('emailsuffix') %] required>
[% Param('emailsuffix') FILTER html %] [% Param('emailsuffix') FILTER html %]
<input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]"> <input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]">
<input type="submit" id="send" value="Send"> <input type="submit" id="send" value="Send">
......
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
<tr> <tr>
<th><label for="passwd1">Type your password</label>:</th> <th><label for="passwd1">Type your password</label>:</th>
<td> <td>
<input type="password" id="passwd1" name="passwd1" value=""> <input type="password" id="passwd1" name="passwd1" value="" required>
(minimum [% constants.USER_PASSWORD_MIN_LENGTH FILTER none %] characters) (minimum [% constants.USER_PASSWORD_MIN_LENGTH FILTER none %] characters)
</td> </td>
</tr> </tr>
<tr> <tr>
<th><label for="passwd2">Confirm your password</label>:</th> <th><label for="passwd2">Confirm your password</label>:</th>
<td><input type="password" id="passwd2" name="passwd2" value=""></td> <td><input type="password" id="passwd2" name="passwd2" value="" required></td>
</tr> </tr>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<table> <table>
<tr> <tr>
<th>Password:</th> <th>Password:</th>
<td><input type="password" name="password" size="36"></td> <td><input type="password" name="password" size="36" required></td>
</tr> </tr>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
......
...@@ -30,17 +30,17 @@ ...@@ -30,17 +30,17 @@
<tr> <tr>
<th>New password:</th> <th>New password:</th>
<td> <td>
<input type="password" name="password"> <input type="password" name="password" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Confirm new password:</th> <th>Confirm new password:</th>
<td> <td>
<input type="password" name="matchpassword"> <input type="password" name="matchpassword" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<td> <td>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<tr> <tr>
<th>Classification:</th> <th>Classification:</th>
<td><input size=64 maxlength=64 name="classification" <td><input size=64 maxlength=64 name="classification"
value="[% classification.name FILTER html %]"></td> value="[% classification.name FILTER html %]" required></td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<tr> <tr>
<th><label for="component">Component:</label></th> <th><label for="component">Component:</label></th>
<td><input size="64" maxlength="64" name="component" id="component" <td><input size="64" maxlength="64" name="component" id="component"
value="[%- comp.name FILTER html %]"></td> value="[%- comp.name FILTER html %]" required></td>
</tr> </tr>
<tr> <tr>
<th><label for="[% desc_name FILTER html %]">Component Description:</label></th> <th><label for="[% desc_name FILTER html %]">Component Description:</label></th>
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
cols = 64 cols = 64
wrap = 'virtual' wrap = 'virtual'
defaultcontent = comp.description defaultcontent = comp.description
mandatory = 1
%] %]
</td> </td>
</tr> </tr>
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
id => "initialowner" id => "initialowner"
value => comp.default_assignee.login value => comp.default_assignee.login
size => 64 size => 64
mandatory => 1
%] %]
</td> </td>
</tr> </tr>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
[% IF field %] [% IF field %]
[% field.name FILTER html %] [% field.name FILTER html %]
[% ELSE %] [% ELSE %]
<input type="text" id="name" name="name" value="cf_" size="40" maxlength="64"> <input type="text" id="name" name="name" value="cf_" size="40" maxlength="64" required>
[% END %] [% END %]
</td> </td>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<th><label for="desc">Description:</label></th> <th><label for="desc">Description:</label></th>
<td> <td>
<input type="text" id="desc" name="desc" size="40" <input type="text" id="desc" name="desc" size="40"
value="[% field.description FILTER html %]"> value="[% field.description FILTER html %]" required>
</td> </td>
<th> <th>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<th><label for="value">Value:</label></th> <th><label for="value">Value:</label></th>
<td> <td>
<input id="value" name="value" size="30" <input id="value" name="value" size="30"
maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]"> maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]" required>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
[% ELSE %] [% ELSE %]
<input id="value_new" name="value_new" size="20" <input id="value_new" name="value_new" size="20"
maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]" maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]"
value="[% value.name FILTER html %]"> value="[% value.name FILTER html %]" required>
[% END %] [% END %]
</td> </td>
</tr> </tr>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<td> <td>
a short name identifying this type.<br> a short name identifying this type.<br>
<input type="text" name="name" value="[% type.name FILTER html %]" size="50" <input type="text" name="name" value="[% type.name FILTER html %]" size="50"
maxlength="50" [%- ' disabled="disabled"' UNLESS can_fully_edit %]> maxlength="50" [%- ' disabled="disabled"' UNLESS can_fully_edit %] required>
</td> </td>
</tr> </tr>
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
cols = 80 cols = 80
defaultcontent = type.description defaultcontent = type.description
disabled = !can_fully_edit disabled = !can_fully_edit
mandatory = 1
%] %]
</td> </td>
</tr> </tr>
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
don't care what order the types appear in or if you want them to appear don't care what order the types appear in or if you want them to appear
in alphabetical order.<br> in alphabetical order.<br>
<input type="text" name="sortkey" value="[% type.sortkey || 0 FILTER html %]" size="5" <input type="text" name="sortkey" value="[% type.sortkey || 0 FILTER html %]" size="5"
maxlength="5" [% ' disabled="disabled"' UNLESS can_fully_edit %]> maxlength="5" [% ' disabled="disabled"' UNLESS can_fully_edit %] required>
</td> </td>
</tr> </tr>
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<table id="admin_table_edit"> <table id="admin_table_edit">
<tr> <tr>
<th>Group Name:</th> <th>Group Name:</th>
<td><input size="60" maxlength="255" name="name"></td> <td><input size="60" maxlength="255" name="name" required></td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
<td><input size="60" name="desc"></td> <td><input size="60" name="desc" required></td>
</tr> </tr>
<tr> <tr>
<th>User Regexp:</th> <th>User Regexp:</th>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<td> <td>
[% IF group.is_bug_group %] [% IF group.is_bug_group %]
<input type="text" name="name" size="60" maxlength="255" <input type="text" name="name" size="60" maxlength="255"
value="[% group.name FILTER html %]"> value="[% group.name FILTER html %]" required>
[% ELSE %] [% ELSE %]
[% group.name FILTER html %] [% group.name FILTER html %]
[% END %] [% END %]
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<td> <td>
[% IF group.is_bug_group %] [% IF group.is_bug_group %]
<input type="text" name="desc" size="60" <input type="text" name="desc" size="60"
value="[% group.description FILTER html %]"> value="[% group.description FILTER html %]" required>
[% ELSE %] [% ELSE %]
[% group.description FILTER html %] [% group.description FILTER html %]
[% END %] [% END %]
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<table id="admin_table_edit"> <table id="admin_table_edit">
<tr> <tr>
<th>Name:</th> <th>Name:</th>
<td><input size="64" maxlength="64" name="name" value=""></td> <td><input size="64" maxlength="64" name="name" value="" required></td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
minrows = 4 minrows = 4
cols = 64 cols = 64
wrap = 'virtual' wrap = 'virtual'
mandatory = 1
%] %]
</td> </td>
</tr> </tr>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<tr> <tr>
<th>Name:</th> <th>Name:</th>
<td><input size="64" maxlength="64" name="name" <td><input size="64" maxlength="64" name="name"
value="[% keyword.name FILTER html %]"></td> value="[% keyword.name FILTER html %]" required></td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
cols = 64 cols = 64
wrap = 'virtual' wrap = 'virtual'
defaultcontent = keyword.description defaultcontent = keyword.description
mandatory = 1
%] %]
</td> </td>
</tr> </tr>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<tr> <tr>
<th><label for="milestone">Milestone:</label></th> <th><label for="milestone">Milestone:</label></th>
<td><input id="milestone" size="64" maxlength="64" name="milestone" <td><input id="milestone" size="64" maxlength="64" name="milestone"
autofocus></td> autofocus required></td>
</tr> </tr>
<tr> <tr>
<th><label for="sortkey">Sortkey:</label></th> <th><label for="sortkey">Sortkey:</label></th>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<tr> <tr>
<th><label for="milestone">Milestone:</label></th> <th><label for="milestone">Milestone:</label></th>
<td><input id="milestone" size="64" maxlength="64" name="milestone" value=" <td><input id="milestone" size="64" maxlength="64" name="milestone" value="
[%- milestone.name FILTER html %]"></td> [%- milestone.name FILTER html %]" required></td>
</tr> </tr>
<tr> <tr>
<th><label for="sortkey">Sortkey:</label></th> <th><label for="sortkey">Sortkey:</label></th>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<tr> <tr>
<th>Version:</th> <th>Version:</th>
<td><input size="20" maxlength="64" name="version" <td><input size="20" maxlength="64" name="version"
value="[% version FILTER html %]"> value="[% version FILTER html %]" required>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
<tr> <tr>
<th>Product:</th> <th>Product:</th>
<td><input size="64" maxlength="64" name="product" <td><input size="64" maxlength="64" name="product"
value="[% product.name FILTER html %]"> value="[% product.name FILTER html %]" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Description:</th> <th>Description:</th>
<td><textarea rows="4" cols="64" wrap="virtual" name="description"> <td><textarea rows="4" cols="64" wrap="virtual" name="description" required>
[% product.description FILTER html %]</textarea> [% product.description FILTER html %]</textarea>
</td> </td>
</tr> </tr>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
value => target_login_default value => target_login_default
accesskey => "u" accesskey => "u"
size => 30 size => 30
mandatory => 1
%] %]
</p> </p>
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
password</label>: password</label>:
<input type="hidden" name="Bugzilla_login" value=" <input type="hidden" name="Bugzilla_login" value="
[%- user.login FILTER html %]"> [%- user.login FILTER html %]">
<input type="password" id="Bugzilla_password" name="Bugzilla_password" size="20"> <input type="password" id="Bugzilla_password" name="Bugzilla_password" size="20" required>
<br> <br>
This is done for two reasons. First of all, it is done to reduce This is done for two reasons. First of all, it is done to reduce
the chances of someone doing large amounts of damage using your the chances of someone doing large amounts of damage using your
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
[% IF editusers %] [% IF editusers %]
<input size="64" maxlength="255" id="login" name="login" <input size="64" maxlength="255" id="login" name="login"
value="[% otheruser.login FILTER html %]" value="[% otheruser.login FILTER html %]"
[%- " autofocus" UNLESS editform %]> [%- " autofocus" UNLESS editform %] required>
[% IF editform %] [% IF editform %]
[% IF !otheruser.in_group('bz_sudo_protect') %] [% IF !otheruser.in_group('bz_sudo_protect') %]
<br> <br>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<th><label for="password">Password:</label></th> <th><label for="password">Password:</label></th>
<td> <td>
<input type="password" size="16" name="password" id="password" <input type="password" size="16" name="password" id="password"
value="" autocomplete="off"> value="" autocomplete="off" [% 'required' IF !editform %]>
[% IF password_complexity == "mixed_letters" %] [% IF password_complexity == "mixed_letters" %]
(Password must contain at least one UPPER and one lowercase letter.) (Password must contain at least one UPPER and one lowercase letter.)
[% ELSIF password_complexity == "letters_numbers" %] [% ELSIF password_complexity == "letters_numbers" %]
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<tr> <tr>
<th><label for="version">Version:</label></th> <th><label for="version">Version:</label></th>
<td><input id="version" size="64" maxlength="64" name="version" <td><input id="version" size="64" maxlength="64" name="version"
value=""></td> value="" required></td>
</tr> </tr>
</table> </table>
<input type="submit" id="create" value="Add"> <input type="submit" id="create" value="Add">
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<th><label for="version">Version:</label></th> <th><label for="version">Version:</label></th>
<td> <td>
<input id="version" size="64" maxlength="64" name="version" <input id="version" size="64" maxlength="64" name="version"
value="[% version.name FILTER html %]"> value="[% version.name FILTER html %]" required>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
value="[% value FILTER html %]" size="40" value="[% value FILTER html %]" size="40"
maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]" maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]"
[% ' pattern="\d+"' IF field.type == constants.FIELD_TYPE_INTEGER %] [% ' pattern="\d+"' IF field.type == constants.FIELD_TYPE_INTEGER %]
[% ' aria-required="true"' IF field.is_mandatory %]> [% ' aria-required="true" required' IF field.is_mandatory %]>
[% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %] [% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %]
[% size = (field.type == constants.FIELD_TYPE_DATE) ? 10 : 20 %] [% size = (field.type == constants.FIELD_TYPE_DATE) ? 10 : 20 %]
<input name="[% field.name FILTER html %]" size="[% size FILTER none %]" <input name="[% field.name FILTER html %]" size="[% size FILTER none %]"
id="[% field.name FILTER html %]" id="[% field.name FILTER html %]"
value="[% value FILTER html %]" value="[% value FILTER html %]"
[% ' aria-required="true"' IF field.is_mandatory %] [% ' aria-required="true" required' IF field.is_mandatory %]
onchange="updateCalendarFromField(this)"> onchange="updateCalendarFromField(this)">
<button type="button" class="calendar_button" <button type="button" class="calendar_button"
id="button_calendar_[% field.name FILTER html %]" id="button_calendar_[% field.name FILTER html %]"
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<span id="[% field.name FILTER html %]_input_area"> <span id="[% field.name FILTER html %]_input_area">
<input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" <input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]"
value="[% value FILTER html %]" size="7" value="[% value FILTER html %]" size="7"
[% ' aria-required="true"' IF field.is_mandatory %]> [% ' aria-required="true" required' IF field.is_mandatory %]>
</span> </span>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
[% SET field_size = field.legal_values.size %] [% SET field_size = field.legal_values.size %]
[% END %] [% END %]
size="[% field_size FILTER html %]" multiple="multiple" size="[% field_size FILTER html %]" multiple="multiple"
[% ' aria-required="true"' IF field.is_mandatory %] [% ' aria-required="true" required' IF field.is_mandatory %]
[% END %] [% END %]
> >
[% IF allow_dont_change %] [% IF allow_dont_change %]
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# multiple: optional, do multiselect box, value is size (height) of box # multiple: optional, do multiselect box, value is size (height) of box
# custom_userlist: optional, specify a limited list of users to use # custom_userlist: optional, specify a limited list of users to use
# field_title: optional, extra information to display as a tooltip # field_title: optional, extra information to display as a tooltip
# mandatory: optional; if true, the field cannot be empty.
#%] #%]
[% IF Param("usemenuforusers") %] [% IF Param("usemenuforusers") %]
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
[% IF accesskey %] accesskey="[% accesskey FILTER html %]" [% END %] [% IF accesskey %] accesskey="[% accesskey FILTER html %]" [% END %]
[% IF multiple %] multiple="multiple" size="[% multiple FILTER html %]" [% END %] [% IF multiple %] multiple="multiple" size="[% multiple FILTER html %]" [% END %]
[% IF field_title %] title="[% field_title FILTER html %]" [% END %] [% IF field_title %] title="[% field_title FILTER html %]" [% END %]
[% IF mandatory %] required [% END %]
> >
[% IF emptyok %] [% IF emptyok %]
<option value=""></option> <option value=""></option>
...@@ -83,6 +85,7 @@ ...@@ -83,6 +85,7 @@
[% IF field_title %] title="[% field_title FILTER html %]" [% END %] [% IF field_title %] title="[% field_title FILTER html %]" [% END %]
[% IF size %] size="[% size FILTER html %]" [% END %] [% IF size %] size="[% size FILTER html %]" [% END %]
[% IF id %] id="[% id FILTER html %]" [% END %] [% IF id %] id="[% id FILTER html %]" [% END %]
[% IF mandatory %] required [% END %]
> >
[% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %] [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
<div id="[% id FILTER html %]_autocomplete_container"></div> <div id="[% id FILTER html %]_autocomplete_container"></div>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<input type="hidden" name="token" <input type="hidden" name="token"
value="[% issue_hash_token(['create-quips']) FILTER html %]"> value="[% issue_hash_token(['create-quips']) FILTER html %]">
<input size="80" name="quip" maxlength="512"> <input size="80" name="quip" maxlength="512" required>
<p> <p>
<input type="submit" id="add" value="Add This Quip"> <input type="submit" id="add" value="Add This Quip">
</p> </p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment