Opened 12 years ago

Closed 12 years ago

#19686 closed New feature (fixed)

Support HTML5 number input type

Reported by: Claude Paroz Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: charette.s@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In #16630, we added support for type="email" and type="url" HTML5 input types.

This ticket is about type="number" input type. It has been separated so as we can discuss specific issues, in particular localization issues.

Attachments (1)

ticket-19686-claudep-github-revised.diff (38.5 KB ) - added by Simon Charette 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Simon Charette, 12 years ago

Cc: charette.s@… added
Has patch: unset
Version: 1.4master

The number input implementation seems to be a bit unstable at the moment.

Chrome implemented it quickly and attempted to localize the input value to the useragent's locale while submitting it the document (or closest parent with a lang attribute) locale. It raised some issues and it's quite hard to work with.

Firefox halted development because many questions arose concerning the decimal mark, group size and separator.

comment:2 by Claude Paroz, 12 years ago

Has patch: set

Pull request, with conditional use of NumberInput depending on Field.localize: https://github.com/django/django/pull/696

comment:3 by Simon Charette, 12 years ago

Patch needs improvement: set

Added some concerns at github.

by Simon Charette, 12 years ago

comment:4 by Simon Charette, 12 years ago

Patch needs improvement: unset

Attached a version of claudep's patch with additionnal tests and a fix forDecimalField's input "maxlength".

comment:5 by Simon Charette, 12 years ago

All tests pass on Python 2.7.3 SQLite3.

comment:6 by Claude Paroz, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 7ec2a21be15af5b2c7513482c3bcfdd1e12782ed:

Fixed #19686 -- Added HTML5 number input type

Thanks Simon Charette for his help on the patch. Refs #16630.

Note: See TracTickets for help on using tickets.
Back to Top