struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther Wieser <>
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

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


Günther Wieser

Guglgasse 6/1/11/1
A-1110 Wien

-----Original Message-----
From: Derrick Koes [] 
Sent: Monday, April 11, 2005 10:42 PM
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;


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message