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

Reply via email to