Re: [Zope] Multiple clicks: how to handle them?

2000-06-30 Thread Jim Hebert

One site I have seen uses javascript on the client side: you get a dialog
box that pops up on-click, tells you to only click once. Since the dialog
is modal, if you did click twice it (did whatever your platform does when
you have a modal dialog box up, eg beeps at you).

(yes, of course, it'd be nice to have a solution requiring javascript, but
I bet you that the people dumb enough to double click the submit button
are the people with javascript on... =)

jim

-- 
Jim Hebert   http://www.cosource.com/
[EMAIL PROTECTED]  The cooperative market for open source software

"Well actually I was considering opening a market in flying pigs. Mostly
because it would be more practical" -- Alan Cox



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Multiple clicks: how to handle them?

2000-06-30 Thread Shane Hathaway

Hung Jung Lu wrote:
 This must be a well-known problem: you click multiple times on a form
 button, and multiple requests are send to the server. On many websites they
 ask you not to click on the "confirm purchase" button twice, because
 otherwise you'll be charged twice.

I've heard a suggestion I like a lot: send a hidden field in the form
with a random but discernably unique value.  When handling the form
submission, before performing any other processing check whether that
random value has already been copied to a small, persistent list.  If
the value is not there yet, add it and continue processing.  But if the
value is found, either stop the processing abruptly or somehow attach
to the thread which is doing the processing and return its contents
when it's finished.

Note that you should not use ZODB persistence to store the list because
each thread gets an independent view of the object database.  The
values should stay in the list for a few seconds beyond the end of the
transaction, so you'll have to implement a basic garbage collection
scheme.

Shane

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )