struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther Wieser <gwie...@creative-it.com>
Subject RE: html:cancel question
Date Mon, 11 Apr 2005 20:44:38 GMT
seems that the browser stops the form from being able to do ANYTHING with
it...

one solution, but it seems dirty to me, is to add another form with only a
cancel button...

kr,
guenther


--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com


-----Original Message-----
From: Derrick Koes [mailto:Derrick_Koes@skillsoft.com] 
Sent: Monday, April 11, 2005 10:42 PM
To: struts-user@apache.org
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message