# Dojo Check Box easy question.

I have a dojo check box that all I am trying to do is find out if it is checked or not.  If it is checked I want it to turn a layer on in my map and if it is not then turn the layer off.  The map part you do not need to worry about but the checked or not checked is really ticking me off.  This should be simple.
``````function changeMap(layers) {
var ShowLayerName, HideLayerName
if(layers === 'streetMap'){
//alert("Found streetMap - " + layers);
HideLayer([imageryPrime])
ShowLayer([streetMap])
}
if(layers === 'imageryPrime'){
//alert("Found imageryPrime - " + layers);
HideLayer([streetMap])
ShowLayer([imageryPrime])
}

if(layers === 'streetMap2'){
//alert("Found streetMap - " + layers);

var layer3 = "streetMap"
var tmpTA = dojo.byId("chkTA");
if (layer3.visible){
tmpTA.Checked = false;
HideLayer([streetMap])
}
else{
tmpTA.Checked = true;
HideLayer([imageryPrime])
ShowLayer([streetMap])
}

if(dijit.byId('chkTA').Checked){
alert("Found chkTA True - " + layers);
}
else
{
alert("Found chkTA False- " + layers);
}
//HideLayer([imageryPrime])
//ShowLayer([streetMap])
}
}

function ShowLayer(layers) {
//hideImageTiledLayers(layers);
for (var i=0; i<layers.length; i++) {
layers[i].show();
}
}

function HideLayer(layers) {
//hideImageTiledLayers(layers);
for (var i=0; i<layers.length; i++) {
layers[i].hide();
}
}

<input id="chkTA" dojotype="dijit.form.CheckBox" name="chkTA" value="streetMap2" type="checkbox" onclick="changeMap(this.value);"/>
<label for="chkTA"> Street Layer </label>
``````
###### Who is Participating?

Commented:
Lowercase C: tempTA.checked.
0

Author Commented:
I hate it when it is so easy.  Thanks.
0

Commented:
You should love it when it's that easy.  It means you can get back to work sooner rather than banging your head trying to figure out a work around. :)
0

Author Commented:
Thanks for the help and sorry for the late response.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.