[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Preventing second click

Subject: Preventing second click
From: "Oleg Konovalov" <olegkon@xxxxxxxxx>
Date: Wed, 27 Sep 2006 23:43:34 -0400
 Preventing second click
Hi,

I have a web XSLT 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), and the same data is getting inserted
again creating duplicate rows.

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 XSL files,
i.e. if the button is in the "grandchild" of the <body> form (child
xsl:include's the parent which includes a grandparent containg the
<body>).
Do they really share a "document" ?
Doesn't seem to work for me.

Or is there a nicer solution ?

Please advise. Any help is very appreciated.

Thank you in advance,
Oleg.
P.S.: Actually, it's a Cocoon/XSLT application with Actions written in Java,
but I didn't want to go into that, hoping for a simple non-Java
solution [without multi-threading and other potential troubles].

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.