title: Disable form submission if checkbox is unchecked
body: <p>I am trying to use function <code>checkbox()</code> to disable form submission.</p>
  
  <p>Can anyone suggest what am i doing wrong?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Here is the code snippet for the JS:</p>
  
  <pre><code>&lt;script type = "text/javascript"&gt;
      function checkbox() {
          if(document.form.checkbox.checked)
          {
              document.form.submit.disabled=false;
          }
          else
          {
              document.form.submit.disabled=true;
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And here is the HTML code.</p>
  
  <pre><code>&lt;form name="form" action="shop_paypal.php" method="post"&gt;
      &lt;input name="cmd" type="hidden" value="_xclick" /&gt;
      &lt;input name="no_note" type="hidden" value="1" /&gt;
      &lt;input name="lc" type="hidden" value="UK" /&gt;
      &lt;input name="currency_code" type="hidden" value="USD" /&gt;
      &lt;input name="bn" type="hidden" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" /&gt;
      &lt;input type="hidden" name="item_name" id="item_name"value="YOUTUBE"/&gt;
      &lt;select name="amount" id="amount" style="width:256px; height:32px;"&gt;
          &lt;option value="18" id="1"&gt;10,000 PINS - $18 &lt;/option&gt;
          &lt;option value="35" id="2"&gt;20,000 PINS - $35&lt;/option&gt;
          &lt;option value="75" id="3"&gt;30,000 PINS - $75&lt;/option&gt;
          &lt;option value="140" id="4"&gt;50,000 PINS - $140&lt;/option&gt;
      &lt;/select&gt;
      &lt;label&gt;Your Facebook fan page URL: &lt;/label&gt;&lt;br /&gt;
      &lt;input class="input-box" type="text" /&gt;
      &lt;input type="text" /&gt;
      &lt;input type="checkbox" class="checkbox" name="checkbox" id="checkbox"/&gt; 
      &lt;label class="agree"&gt;I agree to &lt;a href="#"&gt;Terms &amp; Conditions&lt;/a&gt;&lt;/label&gt;
      &lt;input type="image" src="images/products/buynow.gif" class="submit" onclick= "checkbox();" name = "submit"/&gt;
  &lt;/form&gt;
  </code></pre>