--
Ticket URL: <https://code.djangoproject.com/ticket/28480>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* type: Uncategorized => Bug
* component: HTTP handling => Forms
* resolution: => invalid
Comment:
My research didn't confirm that the `minlength` attribute is invalid.
https://www.w3.org/TR/html5/forms.html#the-maxlength-and-minlength-
attributes
http://caniuse.com/#feat=input-minlength
Perhaps you can cite your source if you believe otherwise.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:1>
Comment (by Tomáš Pecina):
Sure; https://www.w3schools.com/tags/tag_input.asp and, which is even more
relevant, please try this:
{{{
echo '<input minlength=3>' | tidy
}}}
I'm using libtidy to check all HTML during unit testing on my project
(https://github.com/tompecina/legal), and I had to drop minlength because
the output did not pass the test.
In my opinion, it is a matter of good policy not to include any
nonstandard or proprietary HTML markup; it will have no impact on the
validation as the MinLengthValidator is automatically added.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:2>
Comment (by Claude Paroz):
https://validator.w3.org/nu/ does not complain. The latest draft of HTML
5.2 on http://w3c.github.io/html/single-page.html does include the
`minlength` attribute. I confirm this ticket's resolution. You may try
opening a ticket in tidy bugtracker instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:3>
Comment (by Tomáš Pecina):
That's a good point, Claude. HOWEVER, we should realize that minlength is
not the same thing as maxlength, conceptually, and browser developers are
right in not implementing the former very eagerly. With maxlength, there
is a clear and evident visual and possibly acoustic feedback: when the
limit is reached, the user's keypresses are not displayed, and perhaps, a
warning beep is produced. On the other hand, there is no such aid with
minlength. Therefore, it might be wiser to let the Django validator do the
job, and inform the user by a message such as "Currency code must consist
of exactly three characters." By hardcoding the minlength property (which
is not that easy to remove), we may be doing a disservice to the
application developer. Please, give the issue a second thought.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:4>
Comment (by Claude Paroz):
Tomáš, I'd suggest that you explain your issue on the django-developer
mailing list.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:5>
Comment (by Tomáš Pecina):
No, why? I simply think it's not a good idea to use automatically every
property simply because it is there, and caution is needed because certain
checks are better performed on the server (or by JavaScript) than in the
browser. You think otherwise, and you are the boss here, so I supressed
the property manually in my code and this is the end of the story for me.
Thanks for your time, anyway!
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:6>
Comment (by Claude Paroz):
Replying to [comment:6 Tomáš Pecina]:
> You think otherwise, and you are the boss here
That's why I suggested the mailing list, so the decision could be
discussed by more people than just one or two "bosses".
> so I supressed the property manually in my code and this is the end of
the story for me. Thanks for your time, anyway!
If you found a solution working for you, that's great.
--
Ticket URL: <https://code.djangoproject.com/ticket/28480#comment:7>