Closed Bug 1016931 Opened 6 years ago Closed 6 years ago

<input type=number> tooltip text is misleading for violations of attributes "min" and "max" (e.g. says "higher than", but means "at least")

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: JasnaPaka, Assigned: jwatt)

References

(Depends on 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Attached file Testcase
One from our contributors reports bug which is related to "<input type=number>" and attributes "min" and "max". In our example we have this form field:

  <input type="number" min="1" max="99">

If you enter number "0" form field gets red border around because validation error. If you do hover effect you will see tooltip "Please select a value that is higher than 1." This is wrong because number 1 is acceptable value in our example. Tooltip should be something like "... higher or equal to...". The familliar problem is with "max" attribute.
Attached image Screenshot
Original landing bug should be bug 635553.

Also the tooltip for higher limit is not clear: put 100, it says "lower than 99", but it should be "lower than or equal to 99".

The comment says that %S could be a date or a time, which makes it even worse (lower/higher applied to time).
Flags: needinfo?(jwatt)
The strings in question are:
> 36 # LOCALIZATION NOTE (FormValidationRangeOverflow): %S can be a number, a date or a time.
> 37 FormValidationRangeOverflow=Please select a value that is lower than %S.
> 38 # LOCALIZATION NOTE (FormValidationRangeUnderflow): %S can be a number, a date or a time.
> 39 FormValidationRangeUnderflow=Please select a value that is higher than %S.
http://mxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/dom/dom.properties#36
Component: Layout: Form Controls → DOM: Core & HTML
Version: unspecified → Trunk
Summary: <input type=number> shows wrong tooltip for attributes "min" and "max" → <input type=number> tooltip text is misleading for violations of attributes "min" and "max" (e.g. says "higher than", but means "at least")
Attached patch patch (obsolete) — Splinter Review
Yeah, that creates a poor UX. Thanks for the bug report!
Assignee: nobody → jwatt
Attachment #8430387 - Flags: review?(bugs)
Flags: needinfo?(jwatt)
Olli: I've separated date and time because I didn't want to assume that locals would use the same text for both.
Comment on attachment 8430387 [details] [diff] [review]
patch

Review of attachment 8430387 [details] [diff] [review]:
-----------------------------------------------------------------

Please see this MDN page about making string changes ;-)
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_best_practices#Changing_existing_strings
Attachment #8430387 - Flags: feedback-
Attached patch patchSplinter Review
Thanks, Francesco!
Attachment #8430387 - Attachment is obsolete: true
Attachment #8430387 - Flags: review?(bugs)
Attachment #8430937 - Flags: review?(bugs)
Comment on attachment 8430937 [details] [diff] [review]
patch

> # LOCALIZATION NOTE (FormValidationPatternMismatchWithTitle): %S is the (possibly truncated) title attribute value.
> FormValidationPatternMismatchWithTitle=Please match the requested format: %S.
>-# LOCALIZATION NOTE (FormValidationRangeOverflow): %S can be a number, a date or a time.
>-FormValidationRangeOverflow=Please select a value that is lower than %S.
>-# LOCALIZATION NOTE (FormValidationRangeUnderflow): %S can be a number, a date or a time.
>-FormValidationRangeUnderflow=Please select a value that is higher than %S.
>+# LOCALIZATION NOTE (FormValidationNumberRangeOverflow): %S is a number.
>+FormValidationNumberRangeOverflow=Please select a value that is no more than %S.
>+# LOCALIZATION NOTE (FormValidationTimeRangeOverflow): %S is a date.
>+FormValidationDateRangeOverflow=Please select a value that is no later than %S.
>+# LOCALIZATION NOTE (FormValidationTimeRangeOverflow): %S is a time.

You mention FormValidationTimeRangeOverflow twice in the comments. The first one should be about FormValidationDateRangeOverflow
Attachment #8430937 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #8)
> You mention FormValidationTimeRangeOverflow twice in the comments. The first
> one should be about FormValidationDateRangeOverflow

Good catch, thanks.

https://hg.mozilla.org/integration/mozilla-inbound/rev/86fb2abbff1b
https://hg.mozilla.org/mozilla-central/rev/86fb2abbff1b
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Comment on attachment 8430937 [details] [diff] [review]
patch

Why is ther a differents between 

/dom/locales/en-US/chrome/dom/dom.properties
+FormValidationTimeRangeUnderflow=Please select a value that is no earlier than %S.

and
/webapprt/locales/en-US/webapprt/overrides/dom.properties
+FormValidationTimeRangeUnderflow=Please select a value that is no later than %S.

and some other strings?
Tim, see bug above your comment (bug 1023213).
Duplicate of this bug: 970128
Problem stiil appears.
I'm curently on 38.0.5, Polish.

Max for numeric field does not work properly. It says (after translation to english) "Please select value lower than ..." instead of "Please select value lower or equal than ..." (or better "... not higher than" as in Chrome and Opera).
Original message in polish is "Proszę wybrać wartość mniejszą niż ..."
(In reply to aduszczynski from comment #14)
> Max for numeric field does not work properly. It says (after translation to
> english) "Please select value lower than ..." instead of "Please select
> value lower or equal than ..." (or better "... not higher than" as in Chrome
> and Opera).
> Original message in polish is "Proszę wybrać wartość mniejszą niż ..."

Plese file a new bug in Mozilla Localizations::Polish
Filled in Mozilla Localizations::Polish, Bug 1182401
You need to log in before you can comment on or make changes to this bug.