Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#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.

Change History (2)

in reply to:  description comment:1 by Ramiro Morales, 14 years ago

Resolution: duplicate
Status: newclosed

Replying to JMagnusson:

An option to choose whether or not to have radio / checkbox widgets put in a list would be nice.

#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.

Also, an option to not wrap the <label> element around the input element should be implemented.

This was already reported in #13401.

comment:2 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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