Results 1 to 5 of 5

Thread: Form submits twice in IE 5.5 and above

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    6

    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.

  2. #2
    scoutt
    Guest
    can we see some code?

  3. #3
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Yes, I have a few ideas why it might

    cudabean

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    6
    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.

  5. #5
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    364
    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
  •  



Click Here to Expand Forum to Full Width