Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27270 closed Cleanup/optimization (fixed)

Clarify wording of "A form may include HTML attributes such as maxlength"

Reported by: Michael Owned by: Tim Graham
Component: Documentation Version: 1.10
Severity: Normal Keywords: formset
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation reads: "Just like when using a normal Form, each form in the formset may include HTML attributes such as maxlength for browser validation." (https://docs.djangoproject.com/en/1.10/topics/forms/formsets/#formset-validation)

NB: form may include HTML attributes such as maxlength.

What astonishes me: this is not the form that may include maxlength. This is a field in Django and input tag in HTML. Well, a form can contain maxlength neither in Django nor in HTML as far as I know.

Example:

class ArticleForm(forms.Form):
    title = forms.CharField(max_length=5)

Which results in:

<table>
    <tr>
        <th>
            <label for="id_form-0-title">Title:</label>
        </th>
        <td>
            <input id="id_form-0-title" maxlength="5" name="form-0-title" type="text" value="Test" />
        </td>
    </tr>
</table>

Offered wording: Just like when using a normal Form, each form field in each form in the formset may include HTML attributes such as maxlength for browser validation.

Change History (6)

comment:1 by Michael, 8 years ago

Owner: changed from nobody to Michael
Status: newassigned
Type: UncategorizedCleanup/optimization

comment:2 by Michael, 8 years ago

Owner: Michael removed
Status: assignednew

comment:3 by Emett Speer, 8 years ago

This seems like a good update to me. It does make the wording on this much more clear then it currently is.

comment:4 by Tim Graham, 8 years ago

Owner: set to Tim Graham
Status: newassigned
Summary: A form may include HTML attributes such as maxlengthClarify wording of "A form may include HTML attributes such as maxlength"
Triage Stage: UnreviewedAccepted

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In dec77af5:

[1.10.x] Fixed #27270 -- Clarified a paragraph in docs/topics/forms/formsets.txt.

Thanks Kifsif for the suggestion.

Backport of 8110673aafd48e9345c17458638c10fb12ab4f2a from master

comment:6 by Tim Graham <timograham@…>, 8 years ago

In 8110673:

Fixed #27270 -- Clarified a paragraph in docs/topics/forms/formsets.txt.

Thanks Kifsif for the suggestion.

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