#14776 closed (duplicate)
Don't put radio and checkbox input widgets in <ul> lists
Reported by: | JMagnusson | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | m@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
An option to choose whether or not to have radio / checkbox widgets put in a list would be nice. With the current HTML output there's some unnecessary markup. This makes the jQuery UI function 'buttonset' throw a "too much recursion" error when applying it to the <ul> element.
So instead of this:
<li> <label for="id_preferred_language_0">Preferred language</label> <ul> <li><label for="id_language_0"><input checked="checked" type="radio" id="id_language_0" value="1" name="language" />English</label></li> <li><label for="id_language_1"><input type="radio" id="id_language_1" value="2" name="language" />French</label></li> </ul> </li>
Do something like this:
<li> <label for="id_language_0">Preferred language</label> <div id="id_language"> <label for="id_language_0"><input checked="checked" type="radio" id="id_language_0" value="1" name="language" />English</label> <label for="id_language_1"><input type="radio" id="id_language_1" value="2" name="language" />French</label> </div> </li>
Also, an option to not wrap the <label> element around the input element should be implemented.
Note:
See TracTickets
for help on using tickets.
Replying to JMagnusson:
#6388 already ask for this, it even reports that in the
as_p()
form render case, having an UL tag inside a P tag is invalid.This was already reported in #13401.