Link to home
Start Free TrialLog in
Avatar of TheVeee
TheVeeeFlag for United States of America

asked on

Disable a button

Need when the user clicks the button to disable it on a JSP.  Currenlty users are clicking on below button code and not waiting for the results.. Then they get impatient and keep clicking over and over submitting multiple requests...

<input type="submit" value="Submit Query">

Our archictecture is pretty easy because it never returns to this page so I dont need a boolean to check if on or off... just think I need a on click event...

Thanks for the help in advance....

Avatar of enachemc
enachemc
Flag of Afghanistan image

<input type="submit" value="Submit Query" onClick="this.disabled=true">
Avatar of TheVeee

ASKER

ok, it does disable the button, but my form doesnt do the post now to the servlet.. it just hangs there...

I have one jsp which has to includes the header and the footer jsp.  The footer contains the new on click event that does disable the button, but it doesnt do the form post now...  

C.jsp has the <input type="submit" value="Submit Query" onClick="this.disabled=true">
A.jsp has header info
B.jsp contains C and A as includes
ASKER CERTIFIED SOLUTION
Avatar of enachemc
enachemc
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tncbbthositg
tncbbthositg

In XHTML, disabled = true is invalid.  That format is deprecated and theoretically, support for it is going to die out.  If you'd like to maintain forward compatability, you should use element.disabled = 'disabled';

TNC