jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.69k stars 2.41k forks source link

Checkboxes do not work within a listview #467

Closed sschneider83 closed 13 years ago

sschneider83 commented 13 years ago
<ul data-role="listview" data-theme="g">
<li>
     <div data-role="fieldcontain">
  <fieldset data-role="controlgroup">
    <legend>Agree to the terms:</legend>
    <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
    <label for="checkbox-1">I agree</label>
     </fieldset>
    </div>
   </li>
  </ul>
toddparker commented 13 years ago

Listviews are meant to be for navigation, not forms. If you have a form, use a fieldset as a container and get rid of the listview.

matellis commented 13 years ago

The ListView with search box is very handy for having a user select from a long list of categories on a mobile device. A checkbox on this list would be awesomely useful: http://jquerymobile.com/test/#docs/lists/lists-search-with-dividers.html

Unfortunately, jqm makes the whole button the checkbox and so when you scroll you accidentally toggle whatever list item you select.

There's definitely a need to put checkboxes in a listview in jqm regardless of the original intent behind ListView's design.

toddparker commented 13 years ago

I totally agree that we need the ability to format a form into more of a list style and that having a list with checkboxes would be helpful and we're tracking that as a feature requests. https://github.com/jquery/jquery-mobile/wiki/Feature-Requests

We're just not tracking issues for non-supported features right now. Thanks!