AnsweredAssumed Answered

Checking to see if dijit/form/CheckBox is checked

Question asked by GibbyAR on Sep 23, 2013
Latest reply on Sep 23, 2013 by GibbyAR
Given:

function updateLayerVisibility() {     
        var inputs = dojo.query(".list_item"), input;
        visible = [];   
        for (var i=0, il=inputs.length; i<il; i++) {    
          if (inputs[i].checked) {
            visible.push(inputs[i].value);
          }
        }
         //if there aren't any layers visible set the array value to = -1
        if(visible.length === 0){
          visible.push(-1);
        }
  //alert(visible);
        layer.setVisibleLayers(visible);
      } 

--AND--

<input data-dojo-type="dijit/form/CheckBox" checked="checked" class='list_item' id='l0' value=0 onclick="app.updateLayerVisibility()">

The javascript code is not returning the checked status of the CheckBox. Ideas?

Thanks!

rGibson

Outcomes