Closed Bug 962812 Opened 10 years ago Closed 10 years ago

Use the "required" attribute where appropriate

Categories

(Bugzilla :: Bugzilla-General, enhancement)

4.5.1
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: LpSolit, Assigned: sjoshi)

Details

Attachments

(1 file, 1 obsolete file)

There are many fields which are required, e.g. when creating a new product, component, version, target milestone, flag, etc... The "name" field immediately comes to mind, but also the "description" field and some other fields such as the default assignee when creating a new component. For these fields, we should add the "required" HTML5 attribute so that the browser can notify the user before submission.
Assignee: general → joshi_sunil
Attached patch Patch-v1 (obsolete) — Splinter Review
Hope I have covered all of them. :).
Attachment #8365222 - Flags: review?(glob)
Comment on attachment 8365222 [details] [diff] [review]
Patch-v1

LpSolit said he's happy to review this.
Attachment #8365222 - Flags: review?(glob) → review?(LpSolit)
Comment on attachment 8365222 [details] [diff] [review]
Patch-v1

>=== modified file 'template/en/default/account/prefs/account.html.tmpl'

>-        <input type="password" name="old_password">
>+        <input type="password" name="old_password" required>

The password is currently not required to change your real name. This may change in the future, but for now, it's optional.



>=== modified file 'template/en/default/admin/flag-type/edit.html.tmpl'

The sortkey is required too (that's silly, because it should fall back to 0, but it's required).



>=== modified file 'template/en/default/admin/keywords/create.html.tmpl'
>=== modified file 'template/en/default/admin/keywords/edit.html.tmpl'

The description is also required.



>=== modified file 'template/en/default/admin/users/userdata.html.tmpl'

>+             value="" autocomplete="off" [% 'required' IF !editform %] >

Remove the extra whitespace before >.



>=== modified file 'template/en/default/global/userselect.html.tmpl'

>+  # mandatory: optional, if its a mandatory

Write this: optional; if true, the field cannot be empty.


I didn't check if we fixed all the places, but this looks good. :)
Attachment #8365222 - Flags: review?(LpSolit) → review-
Attached patch Patch-v2Splinter Review
Review comments incorporated.
Attachment #8365222 - Attachment is obsolete: true
Attachment #8388074 - Flags: review?(LpSolit)
Comment on attachment 8388074 [details] [diff] [review]
Patch-v2

>=== modified file 'template/en/default/account/email/confirm-new.html.tmpl'

>-        <input type="password" id="passwd1" name="passwd1" value="">
>+        <input type="password" id="passwd1" name="passwd1" value="" required>

Nit: there are several places where the useless value="" is set. It could be safely removed, but leaving it alone is fine.



>=== modified file 'template/en/default/admin/keywords/create.html.tmpl'

>           wrap    = 'virtual'
>+          mandatory      = 1

The indentation of = 1 is a bit weird.


r=LpSolit
Attachment #8388074 - Flags: review?(LpSolit) → review+
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval? → approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   d9cd470..165689a  master -> master
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: