jQuery Mobile: Vertically Grouped Checkbox

This entry is part 15 of 73 in the series jQuery Mobile

Usually, we have the checkboxes arranged in vertical group format.

To integrate multiple checkboxes into a grouped button set, we put data-role=’controlgroup’ attribute on the fieldset.

Vertically Grouped Checkbox
<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header'><h1>Vertical Group Checkbox</h1></div>
    <br>

    <p>Vertical Group Check Box</p>
    <form>
        <fieldset data-role='controlgroup'>
            <input type='checkbox' name='checkbox-v-2a' id='checkbox-v-2a'>
            <label for='checkbox-v-2a'>One</label>
            <input type='checkbox' name='checkbox-v-2b' id='checkbox-v-2b'>
            <label for='checkbox-v-2b'>Two</label>
            <input type='checkbox' name='checkbox-v-2c' id='checkbox-v-2c'>
            <label for='checkbox-v-2c'>Three</label>
        </fieldset>
    </form>
  
    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code
Series Navigation<< jQuery Mobile: Mini Size Checkbox
jQuery Mobile: Horizontal Group Checkbox >>