Hello,
I have added a CANCEL button to my SQLFORM.
Form submission prevents the correct working of it.
I have tried to avoid form submission with this code :
def new_guest_contact():
form = SQLFORM.factory(...)
form[0][-1][1].append(TAG.BUTTON('Cancel',_onclick='ajax("%s",[],":eval");return false' %URL(r=request,f='new_contact')))
if form.process().accepted:
...
redirect(URL(r=request,f='new_contact_part'))
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'Create new guest'
return dict(form=form)
If I click the cancel button now, nothing happens anymore.
Any help is welcome.
Thanks
Mathias