1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #22383 -- Added support for HTML5 required attribute on required form fields.

This commit is contained in:
Jon Dufresne
2016-03-28 11:02:04 -07:00
committed by Tim Graham
parent 4d1c229ee5
commit ec6121693f
28 changed files with 849 additions and 659 deletions

View File

@@ -259,6 +259,12 @@ Forms
* The ``<input>`` tag rendered by :class:`~django.forms.CharField` now includes
a ``minlength`` attribute if the field has a ``min_length``.
* Required form fields now have the ``required`` HTML attribute. Set the new
:attr:`Form.use_required_attribute <django.forms.Form.use_required_attribute>`
attribute to ``False`` to disable it. The ``required`` attribute isn't
included on forms of formsets because the browser validation may not be
correct when adding and deleting formsets.
Generic Views
~~~~~~~~~~~~~
@@ -760,6 +766,11 @@ Miscellaneous
:attr:`ModelAdmin.save_as_continue
<django.contrib.admin.ModelAdmin.save_as_continue>` attribute to ``False``.
* Required form fields now have the ``required`` HTML attribute. Set the
:attr:`Form.use_required_attribute <django.forms.Form.use_required_attribute>`
attribute to ``False`` to disable it. You could also add the ``novalidate``
attribute to ``<form>`` if you don't want browser validation.
.. _deprecated-features-1.10:
Features deprecated in 1.10