Changes between Version 1 and Version 2 of Ticket #36842, comment 2
- Timestamp:
- Jan 5, 2026, 7:07:09 PM (4 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36842, comment 2
v1 v2 1 1 Thanks for the ticket. Admin widgets have used `type="number"` since #27199, with the result that nonsense values get cleaned by the browser to `""`, and thus never make it to Django. 2 2 3 If this is not desired, a [https://docs.djangoproject.com/en/6.0/topics/forms/#the-template workaround] is documented (however, and TIL -- `novalidate` has no effect on `type="number"`, so you workarounds are reduced to just using `TextInput`.):3 If this is not desired, a [https://docs.djangoproject.com/en/6.0/topics/forms/#the-template workaround] is documented (however, and TIL -- `novalidate` has no effect on `type="number"`, so your workarounds are reduced to just using `TextInput`.): 4 4 5 5 > If your form includes a URLField, an EmailField or any integer field type, Django will use the url, email and number HTML5 input types. By default, browsers may apply their own validation on these fields, which may be stricter than Django’s validation. If you would like to disable this behavior, set the novalidate attribute on the form tag, or specify a different widget on the field, like TextInput.