Quantcast
Channel: Catching form submit result - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Catching form submit result

$
0
0

I have a page which calls an external library, this library adds a payment form:

<form name="multipay_form" onsubmit="private_payment_send(); return false;">     ....</form>

I can not change any code here. I need to call a function after form is submitted. What I have done is:

jQuery('form[name="multipay_form"]').on('submit', function() {    alert("myfunction");});

Which works ok, but there is one exception, the method "private_payment_send()", does form validation, I need to know if their function returned true or false, to be able to trigger my function or not.

Is this possible?. I want to avoid doing the validation again on my end, since if they add new field or any new rule I would have to do the same on my code, which is not optimal. Any ideas?

Is there a way to unattach the function from the form through javascript?, in that way I can call private_payment_send() from my function


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>