AT&T Developer
  • Products
  • Resources
  • Blog
  • Sign In

Technical Library

    Device Technologies
    • Biometrics
    • Device Detection
    • HTML5
    • Mobile Web Fundamentals
    • Mobile Web Standards
    • Multi Core Coding in Dalvik
    • Multi Thread Coding in Android
    • Near Field Communication
    • NFC Forum
    • NFC Use Cases
    • NFC Case Studies
    • NFC Tags
    • GlobalPlatform and NFC
    • User Identification
    • Native Code
    Security and Privacy
    • Application Privacy Guidelines
    • Downloading DRM Content in Android
    • IPv6
    • Likelihood of a Successful Attack
    • Messaging Privacy
    • Mobile Web Security
    • Network Security
    • Security Policy
    • Security at AT&T
    • Types of Security Threats
    • Wireless Application Security
    • Security Policy Enforcement
    UI Elements
    • Slider Controls for Android
    • Check Box for Android
    • Dropdown for Android
    • Image Button for Android
    • Toggle Button for Android
    • Radio Button for Android
    • Segmented Text Toggle Button for Android
    • Static Text Toggle Button for Android
    • Switch for Android
    • Text Fields for Android
    • Getting Started with AT&T UI
    • HTML5 UI Elements
    • HTML5 Checkboxes
    • HTML5 Dropdown
    • HTML5 Image Button
    • HTML5 Image Toggle Button
    • HTML5 Radio Button
    • HTML5 Segmented Toggle Button
    • HTML5 Slider
    • HTML5 Static Text Toggle Button
    • HTML5 Switch Control
    • HTML5 Text Fields
    Network Technologies
    • IP Addresses
    • Long Term Evolution (LTE)
    • Network Timers
    • Wi-Fi
  • Other AT&T Websites
  • Best Practices
    • Hackathon Best Practices
    • Mobile Best Practices
    • Seven Common Errors Around Creating Mobile User Experiences
toggle menu

HTML5 Checkboxes

 

The Checkbox UI element enables users to choose among a number of possibilities in an application. There are two kinds of check boxes: normal (in which a check mark can be set or cleared) and mixed (in which an en-dash can be set or cleared). The mixed check boxes might be used at the top of a list, to show that only some of the subcategories have been selected, or in other situations in which a simple "off/on" state is not appropriate. A normal or mixed check box can have three states: off, on (checked), and disabled.

Normal and mixed Checkbox UI elements look like this in an application:


 

Creation of normal checkboxes

 

For creating a group of normal checkboxes you should add a fieldset with data-role:controlgroup. Then for each checkbox to be added, you'll need to include an input and a label as follows:

<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Your Vehicles:</legend>
<input id="checkbox-1" class="custom" type="checkbox" name="checkbox-1" />
<label for="checkbox-1">Car</label>
<input id="checkbox-2" class="custom" type="checkbox" name="checkbox-2" />
<label for="checkbox-2">Bike</label>
<input id="checkbox-3" class="custom" type="checkbox" name="checkbox-3" />
<label for="checkbox-3">Skate</label>
</fieldset>
</div>

The behavior of the checkboxes is the same as the standard html UI elements.

 

Creation of mixed checkboxes

 

The only difference in the implementation is that we will need to add the class="checkbox-alt" to transform this checkbox to a mixed one.

<input id="checkbox-4" class="custom" type="checkbox" name="checkbox-4" />
<label class="checkbox-alt" for="checkbox-4">Car</label>

 

Full code

 

<body>
<div data-role="page" data-theme="b">
<div data-role="header" class="ui-bar-a ui-header" role="banner">
<a id="backButton" href="/index.html" data-icon="arrow-l" data-theme="a">Back</a>
<h1 class="ui-title" tabindex="0" role="heading" aria-level="1">Form Elements</h1>
</div>
<div data-role="content">
<h2>Checkboxes</h2>
<!-- This is a standard checkbox example -->
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Your Vehicles:</legend>
<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
<label for="checkbox-1">Car</label>
<input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
<label for="checkbox-2">Bike</label>
<input type="checkbox" name="checkbox-3" id="checkbox-3" class="custom" />
<label for="checkbox-3">Skate</label>
</fieldset>
</div>
<!-- This is a dash-checkbox example -->
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Your Vehicles:</legend>
<input type="checkbox" name="checkbox-4" id="checkbox-4" class="custom" />
<label for="checkbox-4" class="checkbox-alt">Car</label>
<input type="checkbox" name="checkbox-5" id="checkbox-5" class="custom" />
<label for="checkbox-5" class="checkbox-alt">Bike</label>
<input type="checkbox" name="checkbox-6" id="checkbox-6" class="custom" />
<label for="checkbox-6" class="checkbox-alt">Skate</label>
</fieldset>
</div>
</div>
</div>
</body>
Back To Top
  • APIS & TOOLS
    • AT&T Video Optimizer
  • APIS & TOOLS
    • Futurist Reports
    • Technical Library
  • SUPPORT
    • Contact Us
    • FAQs
    • Twitter
  • AT&T Developer Program on Github
  • AT&T Developer Program on Facebook
  • AT&T Developer Program on Twitter
AT&T Logo

Terms of Use   Privacy Policy   Your Privacy Choices California Consumer Privacy Act (CCPA) Opt-Out Icon
©2025 AT&T Intellectual Property. All rights reserved

AT&T, the AT&T logo and all other AT&T marks contained herein are trademark of AT&T Intellectual Property and/or AT&T affiliated companies.

14100000
Session Expiring

Your session is about to expire in !

Stay Signed In
Session Expired

Sorry! Your session has expired.

Skip to content