Disable Submit Button
<p>i have several array checkbox, 1 submit button and 1 dropdown menu
how can i disable/enable this submit button and dropdown menu when 1 or many checkbox is checked.
when this submit button is disable and user click on it, dialog box appear tell no checkbox is checked</p>

<p>something like this : <a href="http://jsfiddle.net/frantic912/3YbZu/" rel="nofollow">http://jsfiddle.net/frantic912/3YbZu/</a></p>

<pre><code>setButton(buttonGroup) {
    var retArr = new Array();
    if (buttonGroup[0]) {
        for (var i = 0; i &lt; buttonGroup.length; i++) {
            if (buttonGroup[i].checked) {
                document.frm_search.send.disabled = true;
                alert('Please check the first checkbox!');
            }
        }
    }
}


&lt;form  method="post" name="frm_search"&gt;
    &lt;table&gt;
        &lt;tr&gt;  
            &lt;td align="center"&gt;
                &lt;input type="checkbox" name="appr[]" id="appr" value="&lt;?php echo $row['userID']; ?&gt;" onclick="setButton(this);"/&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;bla bla bla&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;select name="slct_appr" id="slct_appr" &gt;
                    &lt;option value="1"&gt;-- Please Choose --&lt;/option&gt;
            &lt;option value="2"&gt;Approve&lt;/option&gt;
                    &lt;option value="3"&gt;None&lt;/option&gt;
                &lt;/select&gt;
            &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="center"&gt;
              &lt;input name="submit" class="submit" id="send" type="submit"  value="send" /&gt;
              &lt;input name="txt_action" type="hidden" id="txt_action" value="frm_add_submit" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
 &lt;/form&gt;
</code></pre>
