For long running actions, I always prefer to use transaction tokens
(built into Struts) and a processing/wait page.  This keeps users busy
watching instead of wondering why the page hasn't changed.

--Kevin 


-----Original Message-----
From: Derrick Koes [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 11, 2005 1:42 PM
To: [EMAIL PROTECTED]
Subject: html:cancel question

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

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

Reply via email to