<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>

CC BY-SA 3.0
2018-03-13T10:38:53.300Z
2018-03-13T10:38:53.300Z
Lukigi
<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>

<plugin-charge><jquery>
jQuery Validate with Charge plugin
# 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:







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

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
 

this works fine


---

