Preventing second click

O

Oleg Konovalov

Hi,

I have a Java 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top