O
Oleg Konovalov
Hi,
I have a Java/JavaScript Web GUI application where I perform a lot of long
DB operations
[e.g. massive SQL Insert's],
which takes 5-60 secs to perform.
Sometimes user double-clicks the button or just gets impatient and clicks
again, which creates duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon
as it's done, re-enable it again.
I tried to do it in Javascript, just simple:
<input... name=Save... onclick="enabled=true;">
and as soon as form reloads, it re-enables the button automatically.
That works in some cases, however when I need to do some other Javascript
operation (e.g. validate the fields on the screen), disabling the button
automatically stops both Javascript and associated form action in Java
which is totally unacceptable.
Is there any other simple solution to such problems in Java or Javascript ?
Thank you in advance,
Oleg.
P.S.: It probably doesn't matter much, but that is a Cocoon2.0/XSLT app
[think of servlet app]
with Actions in Java, using JDK1.4.2 and IE6.
I have a Java/JavaScript Web GUI application where I perform a lot of long
DB operations
[e.g. massive SQL Insert's],
which takes 5-60 secs to perform.
Sometimes user double-clicks the button or just gets impatient and clicks
again, which creates duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon
as it's done, re-enable it again.
I tried to do it in Javascript, just simple:
<input... name=Save... onclick="enabled=true;">
and as soon as form reloads, it re-enables the button automatically.
That works in some cases, however when I need to do some other Javascript
operation (e.g. validate the fields on the screen), disabling the button
automatically stops both Javascript and associated form action in Java
which is totally unacceptable.
Is there any other simple solution to such problems in Java or Javascript ?
Thank you in advance,
Oleg.
P.S.: It probably doesn't matter much, but that is a Cocoon2.0/XSLT app
[think of servlet app]
with Actions in Java, using JDK1.4.2 and IE6.