Rather than try to handle all of this on the client side with javascript, it might be better and easier to just use the Token approach to handle duplicate submits. I believe there was an email just today about this. You can disable the button but the user can still just hit enter again and you'll end up with a duplicate submission (using the token concept this won't be a problem).


Derrick Koes wrote the following on 4/11/2005 1:56 PM:
I have a function to disable buttons onsubmit because I don't want the user to 
keep clicking, especially for long running actions.  However, this seems to 
interfere when the button is an html:cancel, which is a type of submit.  It 
seems to ignore the correct behavior of cancelling and attempts to do a 
validated submit.  What do I need to do to disable buttons AND get cancel to 
work properly?

function disable(form)
{
    var buttons = form.getElementsByTagName("input");
    for (i = 0; i < buttons.length; i++) {
        if (buttons[i].type == "button" || buttons[i].type == "reset" || buttons[i].type 
== "submit") {
            buttons[i].disabled = true;
        }
    }
    return true;
}

Thanks,
Derrick


--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to