title: javascript onchange checkboxes still select on cancel
body: <pre><code>&lt;script&gt;
  function no_email_confirm() { 
    if (document.getElementsByName("no_email")[0].checked == false) {
      return true;
    } else {
     var box= confirm("Sure?");
      if (box==true)
          return true;
      else
         document.getElementsByName("no_email")[0].checked == false;
    }
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>And here is my HTML for the checkbox: </p>
  
  <pre><code> &lt;input type="checkbox" id="no_email"  name="no_email" onchange="no_email_confirm()"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>For some reason, this gives me the confirm pop up the first time I check the box, but not for any click after that. Also, even if I click "Cancel" it still checks the check box. I've searched on here and for some reason, no matter what I try, I can't get it to work properly.</p>
  
  <p>It should confirm if they really want to check the box, if they select "Yes" then it checks it, if not, then it doesn't check it. I can get it to work without the name no_email, but I can't change that..</p>
  
  <p>Anyone have any ideas?</p>