I have a form in which I am trying to hide the submit button once it has been clicked and replace it with a gif image. The code that I am trying is below but I cannot get it to work. Right now both elements show up at the same time. Please help!
<script type="javascript">
function onSubmit(){
document.getElementById('submitButton').style.display = "none";
document.getElementById('progressBar').style.display = "block";
}
</script>
<form action="..." onSubmit="return onSubmit()">
.....
<div id="submitButton">
<input type="button" value="submit">
</div>
<div id="progressBar" style="display: hidden">
<img src="progressbar.gif">
</div>
</form>
<script type="javascript">
function onSubmit(){
document.getElementById('submitButton').style.display = "none";
document.getElementById('progressBar').style.display = "block";
}
</script>
<form action="..." onSubmit="return onSubmit()">
.....
<div id="submitButton">
<input type="button" value="submit">
</div>
<div id="progressBar" style="display: hidden">
<img src="progressbar.gif">
</div>
</form>