Forum Moderators: open
<form name="form1" method="post" action="?">
<input name="cont" value="Submit" type="button" onclick="document.form1.cont.value='Please wait...';document.form1.cont.disabled = true; document.form1.submit();">
</form>
It works when you remove the submit. But after the form is submitted the onclick effects magically disappear. :( Any ideas on how to keep them around?
<form name="form1" method="post" action="?" onsubmit="return disableSubmit();">
<input name="cont" value="Submit" type="submit">
</form>
<script type="text/javascript">
function disableSubmit(){
document.form1.cont.disabled = true;
document.form1.cont.value='Please wait...';
return true;
}
</script>
I hit the back button
Ah! I failed to catch that part in the first post.
Does IE reload the page when you go back to it?
Apparently it does. I put a simple alert() into the body tag and it pops up even when you go back.
So, knowing this, I think one way to do it would be to use the onload event of the body to test if one of your input fields has a value. If it does, then the user must have hit back.
<body onload="checkForBack(document.form1.somefield.value)">
function checkForBack(val){
if (val!= ''){
document.form1.cont.value='Please wait...';
document.form1.cont.disabled = true;
}
}