<div dir="ltr">Sure. Though it is mainly a client-side solution. Here is the Javascript function:<br><div>// jQuery plugin to prevent double submission of forms</div><div>jQuery.fn.preventDoubleSubmission = function() {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(this).on(&#39;submit&#39;,function(e){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var $form = $(this);</div><div> </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if ($form.data(&#39;submitted&#39;) === true) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>// Previously submitted - don&#39;t submit again</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>e.preventDefault();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>// Mark it so that the next submit can be ignored</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>$form.data(&#39;submitted&#39;, true);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>});</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>// Keep chainability</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return this;</div><div>};</div><div><br></div><div>Then, here is how I used it in Seaside:</div><div>(1) I give the form a unique ID (html nextId) and have that in a temporary variable id.</div><div>(2) After the form has been added, I add the following to trigger the Javascript:</div><div>html script: &#39;$(&quot;#&#39;, id asString, &#39;&quot;).preventDoubleSubmission;&#39;.<br></div><div><br></div><div>What this does is that it overrides default behavior to only submit the form once. It would be much nicer if this were taken care of at the server-side (something like &quot;html submitOnceForm&quot; instead of &quot;html form&quot;) as you can never count on the client side to behave properly.</div><div><br></div><div>Cheers,</div><div><br></div><div>Jeff</div></div><br><div class="gmail_quote">On Mon, Apr 20, 2015 at 5:05 AM Hilaire &lt;<a href="mailto:hilaire@drgeo.eu">hilaire@drgeo.eu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
So Paypal does not have this level of safty..<br>
Can you share your implementation? It very likely be useful to the<br>
communnity the next time one wants to learn from it.<br>
<br>
Thanks<br>
<br>
Hilaire<br>
<br>
Le 15/04/2015 19:09, J.F. Rick a écrit :<br>
&gt; I ended up implementing the javascript event handler to disable the<br>
&gt; submit button (not too difficult). It seems crazy that a browser even<br>
&gt; allows for a form to be submitted multiple times. I once got into<br>
&gt; trouble because I was transferring money to my Paypal account and<br>
&gt; accidentally double clicked the submit button. It ended up processing<br>
&gt; the request twice and almost cost me an overdraft fee. It would be<br>
&gt; nice if seaside provided an elegant way to ensure that a form is only<br>
&gt; processed once.<br>
<br>
--<br>
Dr. Geo - <a href="http://drgeo.eu" target="_blank">http://drgeo.eu</a><br>
iStoa - <a href="http://istoa.drgeo.eu" target="_blank">http://istoa.drgeo.eu</a><br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div>