DHTMLX Docs & Samples Explorer

### Checkboxes

Source

    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">

        <script src="../../codebase/dhtmlxcommon.js"></script>
        <script src="../../codebase/dhtmlxform.js"></script>

        <div id="listObj" style="position: relative; width: 250px;"></div>
        <div>
            <input type="button" value="Check All" onclick="check(true);">
            <input type="button" value="UnCheck All" onclick="check(false);">
        </div>
        <script>var dhxList;
    function doOnLoad() {
        dhxList = new dhtmlXForm("listObj");
        dhxList.loadStruct("../common/dhxform2.xml?" + new Date().getTime());
    }
    function check(toCheck) {
        dhxList.forEachItem(function(name) {
            if (dhxList.getItemType(name) == "checkbox")
                dhxList[(toCheck ? "checkItem": "uncheckItem")](name);
        });
    }</script>