#29056: Required SelectDateWidget renders invalid HTML
------------------------------------------+------------------------
Reporter: Vlastimil Zíma | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
`SelectDateWidget` in required field renders an invalid HTML. According to
standard https://www.w3.org/TR/html5/sec-forms.html#placeholder-label-
option every `select` with `required` attribute must have a placeholder
option, i.e. first option must have an empty string as a value. That is
not a case of `SelectDateWidget`.
=== Example ===
{{{
#!python
from django import forms
class FooForm(forms.Form):
a_date = forms.DateField(widget=forms.SelectDateWidget)
form = FooForm()
str(form) # >>> ...<select name="a_date_month" required
id="id_a_date_month"><option value="1">January</option>...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29056>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.247ecbf4cd7213028fffdb23f28625a3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.