jquery control a checkbox from another checkbox
<p>my check-boxes look like</p>

<pre><code>&lt;input type="checkbox" id="checkbox_1" name="artist" value="Yes"&gt;
&lt;input type="checkbox" id="checkbox_2" name="song" value="Yes"&gt;
</code></pre>

<p>and my code is</p>

<pre><code>$(document).ready( function() {
    $('#checkbox_1').click( function() {
        $('#checkbox_2').each( function() {
            this.checked = !this.checked;
        });
        $("#submit").click();
    });
});
</code></pre>

<p>problem is when i check checkbox_1 it doesnt stay checked (it stays deselected).. after <code>$("#submit").click()</code>;</p>

<p>hope you get the ideea</p>

<p>ok ok ok ..</p>

<p>the desired effect is:</p>

<p>Step1: both checkboxes are cleared</p>

<p>Step2: if i select checkbox1 then both checkboxes are selected</p>

<p>Step2: if i deselect checkbox1 then both checkboxes are cleared again</p>

<p>get it ?</p>
