Opened 9 years ago

Closed 9 years ago

#26516 closed New feature (fixed)

Add support for HTML5 minlength attribute on forms.CharField

Reported by: Jon Dufresne Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Just as there is support for the maxlength attribute in rendered forms, Django should add the minlength attribute when it is defined:

Description of attribute:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-minlength

Can add alongside maxlength attribute:

https://github.com/django/django/blob/df8d8d4292684d6ffa7474f1e201aed486f02b53/django/forms/fields.py#L234-L239

Change History (3)

comment:1 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 500e5a68:

Fixed #26516 -- Added minlength attribute when forms.CharField.min_length is set.

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