title: how to see a checkbox is not checked
body: <p>I want to alert user if they haven't checked any checkbox, and return to the form
  After they checked at least one checkbox, proceed into the next page
  How can I do that ?</p>
  
  <pre><code>&lt;input type="checkbox" name="pay[]"  value="
      &lt;?php 
      echo $DateArr[$record_count].";";
      echo $invoiceArr[$record_count].";";
      echo $TotalArr[$record_count].";";
      echo $amount_dueArr[$record_count];
      ?&gt;
      " onClick="checkTotal()"/&gt;
  
  &lt;td ALIGN="right" &gt;&lt;input type="submit" name="submit" value="Continue" onMouseOver="CheckBoxStatus()"&gt;&lt;/td&gt;
  </code></pre>
  
  <p><strong>javascript :</strong></p>
  
  <pre><code>function CheckBoxStatus()
                        {
  
                          var checkbox_status = document.getElementsByName("pay[]").value;                            
                              if (checkbox_status = ";;;")
                              {
                                 alert("Please select at least one to proceed!");
                                 return false;
                              }
                              else
                              {
                                alert("Continue!");
                                return true;
                              }
  
  
                        }
  </code></pre>
  
  <p>If user hasn't checked, at least one checkbox, alert the message and return to form</p>
  
  <p>Then</p>
  
  <pre><code>&lt;form name="payform"  method="POST" action="payment.php"  onSubmit=" CheckBoxStatus()"&gt;
  </code></pre>
  
  <p>How can I stay in the form if user is not checking any checkboxes ?</p>
  
  <p>May be like this :</p>
  
  <pre><code>function CheckBoxStatus()
                            {
                                  if (document.getElementsByName("pay[]").checked == true) 
                                  {
                                      document.forms["payform"].submit(); 
                                      return true;
                                  }
                                  else
                                  {
                                      alert("Please select at least one invoice to proceed!");
                                     document.forms["payform"].reset();   
                                     return false;
  
                                  }
                            }
  </code></pre>
  
  <p>can i do like this :
  `</p>
  
  <pre><code>function CheckBoxStatus()
                            {
                              var status=$("pay[]").attr('checked');
  
                              if (status=true)
                              {
                               //if(document.getElementsByName("pay[]").checked) {
                                  return true;
                              }
                              else {
                                  alert("Please select at least one to proceed!");
                                  return false;
                              }
  
  
                            }`
  </code></pre>