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
Did anyone make jQuery Validate work with Charge?