If the form is being posted back, the page will unload. Any pending requests will be dropped (though the server will continue processing any requests that it has already seen, can't help that). If the post happens via AJAX as well, then you could use a guard variable and simply set it before you do the submit and check it before you send off a request for an update.
I'll assume that you want to do periodic updates until the form is submitted -- a loop is not really the ideal way to handle that. The example below uses setTimeout to poll the server every second -- as long as the form hasn't already been submitted.
var submitted = false;
var timer = null;
$('.submit-button').click( function() {
submitted = true;
if (timer) clearTimeout( timer );
$('form').submit();
return false;
});
function doUpdate()
{
if (!submitted) {
$.ajax({
...
});
timer = setTimeout(doUpdate,1000);
}
}
doUpdate();