Hi,
I'm using an animated gif as a submit button on a form.
What I want is for the user to click the gif, have it run the animation and THEN submit the form.
At the moment when I clcik it it just submits straight away.
Is there any way I can get it to wait until the gif has completed once?
Here is my code at the moment:
<script language="javascript">
<!--
if (document.images) {
var initial = new Image();
initial.src = 'images/stoppost.gif';
var over = new Image();
over.src = 'images/startpost.gif';
}
function ChangeImg(id,name){
document.getElementById(id).src = eval(name + ".src");
}
-->
</script>
<input type="image" align="right" value="submit" name="submitter" src="images/stoppost.gif" alt="Submit Details" onclick="ChangeImg('submitter','over');" onclick="ChangeImg('submitter','initial');">
Thanks.
I'm using an animated gif as a submit button on a form.
What I want is for the user to click the gif, have it run the animation and THEN submit the form.
At the moment when I clcik it it just submits straight away.
Is there any way I can get it to wait until the gif has completed once?
Here is my code at the moment:
<script language="javascript">
<!--
if (document.images) {
var initial = new Image();
initial.src = 'images/stoppost.gif';
var over = new Image();
over.src = 'images/startpost.gif';
}
function ChangeImg(id,name){
document.getElementById(id).src = eval(name + ".src");
}
-->
</script>
<input type="image" align="right" value="submit" name="submitter" src="images/stoppost.gif" alt="Submit Details" onclick="ChangeImg('submitter','over');" onclick="ChangeImg('submitter','initial');">
Thanks.