You can check if internet connection is available and then do Form Submit.
The following code executes every one second and checks if connection is there and if yes then posts data
<script type="text/javascript">
window.onload = function () {
setInterval(function () {
if (navigator.onLine) {
document.forms[0].submit();
}
}, 1000);
}
</script>