Hi Looking into this thread http://groups.google.com/group/web2py/browse_thread/thread/8c0479e1df9df3e3/be160c757aa666b8?lnk=gst&q=code+against+existing+form#be160c757aa666b8
I had the same problem: I had in my view a form : ----------------------------- form name='form2' method="post" > ----------- <input type="submit" /></form> This form has some kind of variable called sector which id is passed through accepting the form and in my controller I've a sector() function that has: ------------------------- if request.args: form = SQLFORM(db.sector, request.args(0)) else: form = SQLFORM(db.sector) if form.accepts(request.vars, formname='form'): # do something form2 = FORM(INPUT(), INPUT(_type='submit')) # This form should exist at all conditions [whether there are args or not] and it's just there because I've 'form2' in my view [I program against an existing form if form2.accepts(request.vars, formname=form2): -> This doesn't execute unless formname=None # do something return dict(form=form,form2=form2 ) Now I have a problem : the accepts part of form2 doesn't evaluate to True unless formname=None, but in this case I get a problem accessing my controller without any arguments locating a place like 127.0.0.1/my_app/controller/sector always redirects me to 127.0.0.1/my_app/controller/sector/None To solve this problem I had to do something like: if form2.accepts(request.vars, formname=None): if request.vars.sector: # a form variable that is sent when accepting form redirect(URL(r=request, c='controller', f='sector', args=[request.vars.sector])) # redirect me to the same function but with an id argument SO is this a bug ? or just it's the usual behavior ? and why doesn't formname='form2' work? Thanks -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.