Does anybody have any idea why when I submit a form in IE 5.5 it would submit twice?
This works fine in IE 5.01 and below.:confused:
Printable View
Does anybody have any idea why when I submit a form in IE 5.5 it would submit twice?
This works fine in IE 5.01 and below.:confused:
can we see some code?
Yes, I have a few ideas why it might :)
cudabean
Well, I figured it out. Yes you guessed it. My code was wrong.
Here it is.
<INPUT type="image" src="images/login.gif" border=0 onClick="submit()">
The problem, if you don't already know, the type was set to image which treats it the same as submit when pressed. I also had a javascript onClick command. So two forms would submit whenever you clicked it.
Funny that this doesn't happen in IE 5.01 or below.
Thanks for the help.
you can use this script that only allows a user to press submit once put this script between <head> and</head>
<script>
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>
then put this code in <form action
onSubmit="submitonce(this)"