#27565: {{ form.as_p }} with RadioSelect generates invalid HTML
-------------------------------------+-------------------------------------
Reporter: Maciej Olko | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.10
Severity: Normal | Resolution:
Keywords: RadioSelect, | Triage Stage:
invalid html, ul | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Description changed by Maciej Olko:
Old description:
> When working with forms, RadioSelect with {{ form.as_p }} renders to:
> {{{
> <p>
> <label for="…">…</label>
> <ul id="…>
> <li><label for="…"><input id="…" name="…" type="radio" value="…"
> required /> …</label></li>
> <li><label for="…"><input id="…" name="…" type="radio" value="…"
> required /> …</label></li>
> …
> </ul>
> </p>
> }}}
> which is totally invalid. Vide
> http://stackoverflow.com/questions/10601345/ul-element-can-never-be-a
> -child-of-p-element .
> It should render to:
> {{{
> <p>
> <label for="…">…</label>
> </p>
> <ul id="…>
> <li><label for="…"><input id="…" name="…" type="radio" value="…"
> required /> …</label></li>
> <li><label for="…"><input id="…" name="…" type="radio" value="…"
> required /> …</label></li>
> …
> </ul>
> }}}
New description:
When working with forms, RadioSelect with {{ form.as_p }} renders to:
{{{
<p>
<label for="…">…</label>
<ul id="…>
<li><label for="…"><input id="…" name="…" type="radio" value="…"
required /> …</label></li>
<li><label for="…"><input id="…" name="…" type="radio" value="…"
required /> …</label></li>
…
</ul>
</p>
}}}
which is invalid. Vide http://stackoverflow.com/questions/10601345/ul-
element-can-never-be-a-child-of-p-element .
It should render to:
{{{
<p>
<label for="…">…</label>
</p>
<ul id="…>
<li><label for="…"><input id="…" name="…" type="radio" value="…"
required /> …</label></li>
<li><label for="…"><input id="…" name="…" type="radio" value="…"
required /> …</label></li>
…
</ul>
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27565#comment:1>
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/065.67dcfa49f8907bf149f9aae1431cbca9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.