I cannot reproduce this:
def test():
db.define_table('person',Field('name'))
form = SQLFORM(db.person)
print 'processing...'
form.process(formname='test')
print db(db.person).select()
print 'done!'
if form.accepted:
print 'accepted'
import time
time.sleep(5)
print 'redirecting...'
redirect(URL('index'))
return locals()
I can click many times but only one record is inserted.
On Wednesday, 2 May 2012 16:55:30 UTC-5, Bruce Wade wrote:
>
> Hi,
>
> We have a form for buying products, the form generated has the _formkey
> when clicking the submit button quick it does look like it doesn't submit
> however it still runs all the code in the accepted method and if you go to
> another page you can see that it really has completed the order.
>
> if ucashmethod.process(formname='ucash').accepted:
> #this code is ran and the form is submitted even if
> redirect(URL('products','index')) # This is not ran at the end if you
> double click the submit button fast.
>
> This has caused a major problem with double submittal of a
> form. Primary because the person doesn't think the form is submitted
> because it keeps them on the same page.
> --
> --
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>