I'm back now -
Try putting this script in the <head> section;
Code:
<script type="text/javascript">
function Throbber()
{
if (!submitted)
{
submitted = true;
Throbber = document.getElementById('throbber_img');
document.getElementById('waiting').style.display = 'block';
setTimeout('Throbber.src = Throbber.src',100);
return true;
}
}
function FormSubmit()
{
document.MyFormName.submit(); // define the name of the form to submit here
document.getElementById('waiting').style.display = 'block'
return false;
}
</script>
And edit your form in the <body> of your web page to include this;
Code:
<form action="process.php" method="post" name="MyFormName" id="form1">
...
<!-- Submit form with javascript - replace <input type="submit" with <input type="button" -->
<input type="button" id="sub" value="submit" onclick="FormSubmit();">
</form>
<div style="display:none;" id="waiting">
<img id="throbber_img" src="images/throbber.gif"> Please wait while we process your request...
</div>
Please follow the comments in the snippets.
Bookmarks