Nevermind, if you have the same problem check the topic: LOAD/web2py component improved web2py_trap_form On Sat, Apr 23, 2011 at 3:56 AM, Tito Garrido <titogarr...@gmail.com> wrote:
> Hi Folks, > > I'm using a sqlform factory form with LOAD and seems that the form doesn't > respond when I click the submit for the first time... not sure why the post > is sent but seems that it doesn't get accepted... then if I click again it > works... is that expected? > > Example of code: > *Controller*: > > def my_form_loading(): > form = SQLFORM.factory( > ..Whatever you want..) > if form.accepts(request.vars, session, hideerror=True): > form.vars.id = db.table.insert(field=var...) > response.js = "do stuff" > response.flash = 'good' > elif form.errors: > response.flash = 'Erro' > > return dict(form=form) > > *ON a view:* > > {{=LOAD('default','my_form_loading.load', ajax=True)}} > > > > -- > > Linux User #387870 > .........____ > .... _/_õ|__| > ..º[ .-.___.-._| . . . . > .__( o)__( o).:_______ > -- Linux User #387870 .........____ .... _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:_______