How to stop form execution without using prevent default?
<p>My form is a payment gateway integration form. 
I need to save details to the database first, then only need to send the details to the payment gateway. 
When I submit the form I need to check it's validity with some php operation. After doing the php operation I need to actually submit the form.</p>

<p>Can you suggest a good method to solve this?</p>

<p>This is my form </p>

<pre><code>&lt;form method="post" action="paymentgatway url " id="myForm"&gt;

&lt;input type="text" name="name1" requried&gt;
&lt;input type="text" name="cash" requried&gt;
&lt;input type="submit" name="submit1" id="submit1" value="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>and PHP</p>

<pre><code>var $myForm = $('#myForm');
    if ($myForm[0].checkValidity()) {
     &lt;?php some php code ?&gt;

     then submit the form 

    }   
    else{

          $myForm.find(':submit').click();

    } 
</code></pre>