title: JavaScript to add an item to the cart is broken
body: <p>I've got a button, which is part of the provided code in my Magento theme, and according to the date/time stamp, I haven't inadvertantly edited it. I'm sure that it was working at some point, but a glance back into my source control over the last week, and I can't seem to track down where things went wrong.</p>
  
  <p>Here is the button HTML:</p>
  
  <pre><code>&lt;button type="button" title="Add to Cart" class="button btn-cart" onclick="productAddToCartForm.submit(this)"&gt;&lt;span&gt;&lt;span&gt;Add to Cart&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;
  </code></pre>
  
  <p>... but when I click on it nothing happens. Seems pretty straight forward, except I can't see if/where there is a typo, etc. So, I check Firebug and I see the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/GcjDk.png" alt="enter image description here"></p>
  
  <p>However, when I go to "View page source", the script is indeed in the page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
      var productAddToCartForm = new VarienForm('product_addtocart_form');
      productAddToCartForm.submit = function(button, url) {
          if (this.validator.validate()) {
              var form = this.form;
              var oldUrl = form.action;
  
              if (url) {
                 form.action = url;
              }
              var e = null;
              try {
                  this.form.submit();
              } catch (e) {
              }
              this.form.action = oldUrl;
              if (e) {
                  throw e;
              }
  
              if (button &amp;&amp; button != 'undefined') {
                  button.disabled = true;
              }
          }
      }.bind(productAddToCartForm);
  
      productAddToCartForm.submitLight = function(button, url){
          if(this.validator) {
              var nv = Validation.methods;
              delete Validation.methods['required-entry'];
              delete Validation.methods['validate-one-required'];
              delete Validation.methods['validate-one-required-by-name'];
              if (this.validator.validate()) {
                  if (url) {
                      this.form.action = url;
                  }
                  this.form.submit();
              }
              Object.extend(Validation.methods, nv);
          }
      }.bind(productAddToCartForm);
  //]]&gt;
  &lt;/script&gt;
  </code></pre>