Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1017
  • Last Modified:

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){
  				        alert("layer3.visible = true")
  				        tmpTA.Checked = false;
                        HideLayer([streetMap])
                    }
                    else{
   				    alert("layer3.visible = false")
                       tmpTA.Checked = true;
                        HideLayer([imageryPrime])
                        ShowLayer([streetMap])
                    }
                    
                
                
                
                      if(dijit.byId('chkTA').Checked){
                        //ShowLayer([TradeAreaTracts]);
                        alert("Found chkTA True - " + layers);
                     }
                     else
                     {   
                         alert("Found chkTA False- " + layers);
                       //HideLayer([TradeAreaTracts]);
                    }  
                //HideLayer([imageryPrime])
                //ShowLayer([streetMap])
            }  
      }
 
 
 
 
      function ShowLayer(layers) {
      alert("ShowLayer")
        //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>

Open in new window

0
flfmmqp
Asked:
flfmmqp
  • 2
  • 2
1 Solution
 
Bane83Commented:
Lowercase C: tempTA.checked.
0
 
flfmmqpAuthor Commented:
I hate it when it is so easy.  Thanks.
0
 
Bane83Commented:
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
 
flfmmqpAuthor 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.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now