I can only modify the code in the ajax call. The ajax call occurs when I click the submit in form named $(\'#form1\').
$(\'#form1\')
$(\'#form1\').submit(func
You can change button type from "submit" to "button" then submit form using jquery form.submit(); function according to your conditions. Consider the following example code below: