Unable to access the submit button script as it lies in the template.
You can create a Form pre submit rule in Form Options.
If you return the boolean value false or if you return a promise that gets rejected, the submission will not happen.
See this question and answer on how to do it with a promise.
Whats the best way to run a DDS on pre-submit and wait for the result?