Answers.Body: <p>Silly me, this has nothing to do with charge.js, one simply can't have a button with an id="submit" as weird things will happen - <a href="https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript">see this thread</a></p>
  
  <pre><code>&lt;input type="button" id="otherThanSubmit"&gt; 
  </code></pre>
  
  <p>this works fine</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-13T10:38:53.300Z
Answers.LastActivityDate: 2018-03-13T10:38:53.300Z
Answers.UserDisplayName: Lukigi
Body: <p>I'm trying to validate my form before the charge.js is triggered.</p>
  
  <p>I've decided to drop submit button in favour of a standard button and then use valid() method to process submit, so this is what I have now:</p>
  
  <pre><code>&lt;form id="charge-form"&gt;
  &lt;!-- some fields here !--&gt;
  &lt;input id="submit" type="button" value="Subscribe"&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
    $("#charge-form").validate();
    $("#charge-form").charge();
    $("#submit").click(function() {
      if ($("#charge-form").valid()) {
          $("#charge-form").submit();
      }
    })
  &lt;/script&gt;
  </code></pre>
  
  <p>Validation works, and when testing the conditional statement with console.log it also works properly, but when actually used it gives $form.get(...).submit is not a function in the console in charge.js</p>
  
  <p><a href="https://i.sstatic.net/FNxBs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FNxBs.png" alt="enter image description here"></a></p>
  
  <p>Did anyone make jQuery Validate work with Charge?</p>
  
Tags: <plugin-charge><jquery>
Title: jQuery Validate with Charge plugin
ThreadText: # jQuery Validate with Charge plugin
  
  (Asked by: username_0 on 2018-03-12)
  
  I'm trying to validate my form before the charge.js is triggered.
  
  I've decided to drop submit button in favour of a standard button and then use valid() method to process submit, so this is what I have now:
  
  ```
  <form id="charge-form">
  <!-- some fields here !-->
  <input id="submit" type="button" value="Subscribe">
  </form>
  
  <script>
    $("#charge-form").validate();
    $("#charge-form").charge();
    $("#submit").click(function() {
      if ($("#charge-form").valid()) {
          $("#charge-form").submit();
      }
    })
  </script>
  
  ```
  
  Validation works, and when testing the conditional statement with console.log it also works properly, but when actually used it gives $form.get(...).submit is not a function in the console in charge.js
  
  [![enter image description here](https://i.sstatic.net/FNxBs.png)](https://i.sstatic.net/FNxBs.png)
  
  Did anyone make jQuery Validate work with Charge?
  
  **Tags:** plugin-charge, jquery
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-03-13. Score: 2 | Accepted answer
  
  Silly me, this has nothing to do with charge.js, one simply can't have a button with an id="submit" as weird things will happen - [see this thread](https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript)
  
  ```
  <input type="button" id="otherThanSubmit"> 
  
  ```
  
  this works fine
  
  
  ---
  
  