xsl-list
[Top] [All Lists]

RE: [xsl] Preventing second click

2006-09-28 05:03:50
You can also try something like this:

<input type="image" src="{$varContinueBtn}" value="submit"
onClick="this.style.display='none'; divProcessingText.style.display=''"
border="0" alt="continue" name="btnSubmit" id="btnSubmit" width="125"
runat="server" /><span id="divProcessingText" style="display:
none;">Processing...</span>

Hope this helps!
Trish 

-----Original Message-----
From: Geert Josten [mailto:geert(_dot_)josten(_at_)daidalos(_dot_)nl] 
Sent: Thursday, September 28, 2006 7:15 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Preventing second click

Hi Oleg,

I think your method is in principle right. Disable the button on the
HTML page as soon as it is clicked. Though you don't need the onload
part. You generate the HTML yourself, so by default it should be enabled
and only clicking it will disable it.

About the XSL 'parent and child' files, that should not be of concern.
You generate one HTML file to which the several XSL's each contribute a
part. Just make sure things match in the end result (the HTML page),
that is all you need to care. Besides, dropping the onload part, might
'solve' this, as in that case your javascript only concerns the submit
'button'. :-)

And Yes, you could have asked on the Cocoon list as well.. ;-)

Kind regards,
Geert

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].

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u
dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te
verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>