From ec6121693f112ae33b653b4364e812722d2eb567 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 28 Mar 2016 11:02:04 -0700 Subject: Fixed #22383 -- Added support for HTML5 required attribute on required form fields. --- docs/topics/forms/formsets.txt | 5 +++++ docs/topics/forms/index.txt | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'docs/topics/forms') diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 8aa3f67b2a..6a0a43b7c1 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -164,6 +164,11 @@ As we can see, ``formset.errors`` is a list whose entries correspond to the forms in the formset. Validation was performed for each of the two forms, and the expected error message appears for the second item. +Just like when using a normal ``Form``, each form in the formset may include +HTML attributes such as ``maxlength`` for browser validation. However, forms of +formsets won't include the ``required`` attribute as that validation may be +incorrect when adding and deleting forms. + .. method:: BaseFormSet.total_error_count() To check how many errors there are in the formset, we can use the diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index 487f8dd64e..86de7d1b06 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -259,7 +259,7 @@ The whole form, when rendered for the first time, will look like: .. code-block:: html+django - + Note that it **does not** include the ``
`` tags, or a submit button. We'll have to provide those ourselves in the template. @@ -512,11 +512,11 @@ Here's the output of ``{{ form.as_p }}`` for our ``ContactForm`` instance: .. code-block:: html+django

-

+

-

+

-

+

-- cgit v1.3