Solved

Dojo Check Box easy question.

Posted on 2008-10-16
4
1,006 Views
Last Modified: 2012-08-13
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
Comment
Question by:flfmmqp
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Bane83 earned 500 total points
ID: 22735222
Lowercase C: tempTA.checked.
0
 

Author Comment

by:flfmmqp
ID: 22758657
I hate it when it is so easy.  Thanks.
0
 
LVL 10

Expert Comment

by:Bane83
ID: 22759168
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 Closing Comment

by:flfmmqp
ID: 31506728
Thanks for the help and sorry for the late response.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JavaScript waiting 14 66
Retrieve response header - authorization bearer token 34 87
Animated .jpg? 13 57
How can I get this SlideToggle to behave? 6 12
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now