0

I wrote a simple function:

function updatePhase6Visibility(checkbox) {
            //alert("working");
            if (checkbox.checked) {
                Phase6.show();
            }
            else {
                Phase6.hide();
            }
        }

The checkbox is shown in HTML using:

<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" checked onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>

The initial state is checked - how do I change this to unchecked?

tshepang
  • 12,111
  • 21
  • 91
  • 136
BretW
  • 199
  • 10
  • 1
    Okay - I got the answer - simply remove the statement "Checked" from the HTML portion. – BretW Feb 24 '14 at 19:36

1 Answers1

1

Remove "checked"

Original:
<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" checked onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>

Updated:
<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>
88mary256
  • 1,354
  • 1
  • 8
  • 6