Is there a way to stop form submission AFTER it has already been started.
Here is what I mean. I have a code like this:
<form method="POST"
action="/hell">
<input type="text" name="filename">
<input type="submit">
</form>
<script type="text/javascript">
$('form').on('submit', function (event) {
setTimeout(function () {
// And here i need to stop the form submission process
}, 1000);
});
</script>
To simplify the example let's say that the form target page never answers faster than in couple seconds.
What I really want to achieve here is something like non-ajax submission abortion. Is it even possible?
ADDED:
I'm trying to make a jQuery plugin (for some specific needs) and in order to send files with a form I use iframe to fake synchronous ajax request. But can't find a way to abort the submission on i timeout.
Yes, I'm aware of FormData (which is not suitable for me, I can sweep aside IE < 9, but IE 9 support is required), as well as about a bunch of plugins, which still use iframe under the hood (none of them can serve my needs).