Select to view content in your preferred language

CheckBox  placement and control

664
1
02-01-2011 08:16 AM
AngieGreig
Deactivated User
I am using a check box to control the visibility of layer 2. The following code works but does not place the check box where I want on the map.

html file
        <div  <input id='laya'></div>

js file
        var laya = new dijit.form.CheckBox({
            name: "laya",
            value: 2,
            checked: false,
            onChange: function(b) {
                visible = [0,1,laya.attr('value'),3]
                globals.RACELayerDynamic.setVisibleLayers(visible);
            }
------------------------------
This second piece of code places the check box where I want but I was unable to create functionality in the js file.

html file
<div <input type='checkbox'  id='laya'></div>

css file
      #laya{
        position:absolute;
        right:10px;
        top:75px;
      }

This is the first time I have used the check box so I suspect it is something simple I am not understanding.
Thanks,
Angie
0 Kudos
1 Reply
AngieGreig
Deactivated User
I figured out the solution.  I needed a separate id  for the div in addition to the id for the input.
0 Kudos