Opened 5 years ago

Closed 5 years ago

Last modified 4 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: UI/UX:

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)

comment:1 in reply to: ↑ description Changed 5 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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