title: Javascript validation code to make sure that at least one checkbox is marked
body: <p>How would I add javascript validation to make sure that at least one of the items is checked?</p>
  
  <p>Select from courses below:</p>
  
  <pre><code>        &lt;ul id="class_prices"&gt;
               &lt;li&gt;
  
                  &lt;input onclick="update()" name="lbsm" id="lsbm" type="checkbox" value="lbsm"&gt;
                  &lt;label&gt;Law &amp;amp; Business Study Material ($59.00)&lt;/label&gt;
              &lt;/li&gt;
  
              &lt;li&gt;
  
                  &lt;input onclick="update()" name="tsm" id="tsm" type="checkbox" value="tsm"&gt;
                  &lt;label&gt;Trade Study Material ($59.00)&lt;/label&gt;
              &lt;/li&gt;
              &lt;li&gt;
  
                  &lt;input onclick="update()" name="lbepc" id="lbepc" type="checkbox" value="lbepc"&gt;
                  &lt;label&gt;Law &amp;amp; Business Exam Preperation Class ($50.00)&lt;/label&gt;
              &lt;/li&gt;
              &lt;li&gt;
  
                  &lt;input onclick="update()" name="tepc" id="tepc" type="checkbox" value="tepc"&gt;
                  &lt;label&gt;Trade Exam Preperation Class ($50.00)&lt;/label&gt;
              &lt;/li&gt;
  
          &lt;/ul&gt;
  
          &lt;/td&gt;
  
              &lt;td&gt;&lt;h2&gt;$&lt;span id="coursetotal"&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  </code></pre>
  
  <p>Here is javascript code that I have, which does not work.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function valthisform() {
      var chkd = document.form1.lsbm.checked || document.form1.tsm.checked||  document.form1.lbepc.checked|| document.form1.tepc.checked
  
      if (chkd == true) { } else { alert ("please check a checkbox") }
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>I will appreciate your feedback.</p>