Disabling button in client side does not fire server side event

Hi,

I am trying to disable a button after its clicked once. I am setting the button's 'disabled' attribute to 'true' in the client side method that is invoked using onClick(). But if I set this attribute, the server side event does not get fired and hence the submit does not occur.

Please advise me as to how to disable the button on the client side and also perform the server side submit.

Thanks,

[430 byte] By [pretty22a] at [2007-11-27 5:07:59]
# 1
Add a timeout of 10~50ms. The Javascript setTimeout() function can be useful here.
BalusCa at 2007-7-12 10:27:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for ur suggestion. But how can I determine which timeout interval is the best?
pretty22a at 2007-7-12 10:27:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Play with it :) 10ms ought to be sufficient. If you want to be safe, then do at least 50ms, which is still short enough ;)
BalusCa at 2007-7-12 10:27:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
50 ms is preety good for that.bala
art84a at 2007-7-12 10:27:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Thanks for all ur input!

I am caling the setTimeout method in the doSubmit() javascript method that is invoked from onClick().

For Ex:

function doSubmit() {

setTimeout("document.getElementById('button1').disabled = true", 50);

return true;

}

<input type="submit" value="Submit" id="button1" onClick="return doSubmit();">

This is working perfectly fine. Just wanted to post the solution here for anyone else who is having a similar problem.

Thanks!

pretty22a at 2007-7-12 10:27:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...