#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 , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 9 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:3 by , 9 years ago
comment:4 by , 9 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
| Summary: | A form may include HTML attributes such as maxlength → Clarify wording of "A form may include HTML attributes such as maxlength" |
| Triage Stage: | Unreviewed → Accepted |
This seems like a good update to me. It does make the wording on this much more clear then it currently is.