O
Oleg Konovalov
Hi,
I have a web application which is (among other things) doing large SQL
Insert's,
so sometimes it takes a while, user becomes impatient and clicks again (or
just does double-click),
so the same data is getting inserted again.
I was thinking of some simple solution in Javascript.
something like:
<input name=myBtn onclick="this.disable=true;" />
and
<body onload="if (document.myBtn.disabled) document.myBtn.disabled=false;"
/>
....
</body>
Do you think that might work ?
(that input is not a Submit button, the page actually reloads when any DB
transaction is done)
The complication is that the <body> and <input> are in different files,
i.e. if the button is in the "grandchild" of the <body> form (child includes
the parent which includes a grandparent).
Do they really share a "document" ?
Or is there a nicer solution ?
Please advise.
Thank you in advance,
Oleg.
I have a web application which is (among other things) doing large SQL
Insert's,
so sometimes it takes a while, user becomes impatient and clicks again (or
just does double-click),
so the same data is getting inserted again.
I was thinking of some simple solution in Javascript.
something like:
<input name=myBtn onclick="this.disable=true;" />
and
<body onload="if (document.myBtn.disabled) document.myBtn.disabled=false;"
/>
....
</body>
Do you think that might work ?
(that input is not a Submit button, the page actually reloads when any DB
transaction is done)
The complication is that the <body> and <input> are in different files,
i.e. if the button is in the "grandchild" of the <body> form (child includes
the parent which includes a grandparent).
Do they really share a "document" ?
Or is there a nicer solution ?
Please advise.
Thank you in advance,
Oleg.