|
-
Jan 22nd, 2002, 12:46 PM
#1
Thread Starter
New Member
Form submits twice in IE 5.5 and above
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.
-
Jan 22nd, 2002, 03:26 PM
#2
-
Jan 22nd, 2002, 04:02 PM
#3
Addicted Member
Yes, I have a few ideas why it might 
cudabean
-
Jan 22nd, 2002, 04:02 PM
#4
Thread Starter
New Member
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.
-
Jan 23rd, 2002, 05:57 AM
#5
Hyperactive Member
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)"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|