Please show all the relevant code (button creation, view, etc.). Are you sure the condition request.post_vars.submit=="Delete": is True? Is the form being submitted via Ajax?
Anthony On Sunday, January 28, 2018 at 5:23:20 AM UTC-5, Alfonso Serra wrote: > > Im have created a form with 2 submits for update and delete the record but > whatever i do the record is not deleted: > > This is the controller > tbl = request.args(0) > > if request.post_vars and request.post_vars.submit=="Delete": > request.post_vars['delete_this_record'] = "on" > request.post_vars['delete_check'] = "on" > > form = SQLFORM(db[tbl], 11, deleteable=True).process(formname=tbl) > if form.accepted: > print "All good" > print request.post_vars > elif form.errors: > print form.errors > > return locals() > > request.post_vars.id is 11 to avoid the user tampering error and the form > is accepted but updates the record instead delete it. > ill delete the record using a query but would like to know why the SQLFORM > is not doing it > . > By the way, this code worked on an old project i had with > "delete_this_record". I have seen on appadmin that this has changed to > "delete_check". > > King regards. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

