Open Bug 962818 Opened 10 years ago Updated 9 years ago

Use the "pattern" attribute where appropriate

Categories

(Bugzilla :: Bugzilla-General, enhancement)

4.5.1
enhancement
Not set
normal

Tracking

()

People

(Reporter: LpSolit, Unassigned)

References

Details

(Keywords: html5)

There are some fields such as sortkeys or the deadline or other timetracking fields which only accept some specific type of data (integers, dates, etc..). We should use the "pattern" HTML5 attribute to let the browser validate data before submission. Note that per the HTML5:

"the pattern attribute is matched against the entire value, not just any subset (somewhat as if it implied a ^(?: at the start of the pattern and a )$ at the end)."

This means that there is no need to write ^ and $ ourself. That's automatically done by the browser. Also:

"When a control has a pattern attribute, the title attribute, if used, must describe the pattern."

This is because if the user enters bad data, the browser will display the title attribute to explain the user what's wrong. And so the title must describe the expected input, else the user has no way to know what is the expected input.
Keywords: html5
Target Milestone: Bugzilla 5.0 → ---
Depends on: 1160809
You need to log in before you can comment on or make changes to this bug.