#28303: IntegerField & NumberInput widget localize max_value when rendering form
field
----------------------------------------+------------------------
Reporter: Richard Owen | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
This issue is a change / regression in Django 1.11. It works correctly
with Django 1.10. Tested on Django 1.11.2 and Python 2.7.13.
== Reproduction Steps
1. Enable the following settings:
{{{
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
}}}
2. Create a form with an IntegerField with a large max_value set:
{{{
class TestForm(forms.Form):
integer_field = forms.IntegerField(max_value=999999)
}}}
== Expected Result
Form is rendered as
{{{
<input type="number" name="integer_field" max="999999" required
id="id_integer_field" />
}}}
== Actual Result
Form is rendered as
{{{
<input type="number" name="integer_field" max="999,999" required
id="id_integer_field" />
}}}
Note the comma separator in the max attribute on the input.
Internet Explorer 11 treats this field as having a max attribute of 999.
So entering a value of 1000 in the field prevents the user from submitting
the form.
--
Ticket URL: <https://code.djangoproject.com/ticket/28303>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.c325c9a0ba65e42eff4448141fd64401%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.