The checkbox radio component changes the default browser checkboxes and radio buttons to a form more adapted to the mobile environment.
By default, all <input>
elements with the type="checkbox"
or type="radio"
attribute are displayed as checkboxes and radio buttons.
To create a checkbox radio component:
<input type="checkbox" name="checkbox-yes" id="checkbox-yes" /> <label for="checkbox-yes">Yes</label>
Method | Description |
---|---|
disable ( ) |
Disables the component. |
enable ( ) |
Enables the component. |
getCheckedElement ( ) |
Returns a checked checkbox radio element. |
disable
Disables the component.
disable ( )
Return value:
Type | Description |
---|---|
Checkboxradio | Returns this. |
Code example:
<input type="checkbox" name="checkbox-1" id="checkbox-1"/><label for="checkbox-1">Normal</label> <script> var element = document.getElementById("checkbox-1"), checkboxWidget = tau.widget.Checkboxradio(element); checkboxWidget.disable(); </script>
enable
Enables the component.
enable ( )
Return value:
Type | Description |
---|---|
Checkboxradio | Returns this. |
Code example:
<input type="checkbox" name="checkbox-1" id="checkbox-1"/><label for="checkbox-1">Normal</label> <script> var element = document.getElementById("checkbox-1"), checkboxWidget = tau.widget.Checkboxradio(element); checkboxWidget.enable(); </script>
getCheckedElement
Returns a checked checkbox radio element.
HTMLElement getCheckedElement ( )
Return value:
Type | Description |
---|---|
HTMLElement |
Code example:
<input type="checkbox" name="checkbox-1" id="checkbox-1"/><label for="checkbox-1">Normal</label> <script> var element = document.getElementById("checkbox-1"), checkboxWidget = tau.widget.Checkboxradio(element); checkboxWidget.getCheckedElement(); // Returns checked checkbox element </script>