redirect(URL(....,vars=request.vars))
On Apr 9, 12:06 am, waTR <[email protected]> wrote:
> I ended up making it work via using a session variable I created
> called c__register and passing the request.vars via that.
>
> However, it would be nice to avoid temporary session storage and
> simply forward post_vars directly to another controller...
>
> On Apr 8, 9:57 pm, waTR <[email protected]> wrote:
>
> > I have a form, and I would like to validate the form in one
> > controller, and then once the form is validated, pass its request.vars
> > to another controller for it to enter the info into the DB. Is this
> > possible? How?
>
> > form=FORM(TABLE(TR("Your nickname:",INPUT
> > (_type="text",_name="nick",requires=IS_NOT_EMPTY(),
> > _class="frm_field")),
> > TR("Your email:",INPUT
> > (_type="text",_name="email",requires=IS_EMAIL(), _class="frm_field")),
> > TR("Password:", INPUT(_type="password",
> > _name='pass1', requires=IS_NOT_EMPTY(), _class="frm_field")),
> > TR("Re-enter Password:", INPUT(_type="password",
> > _name='pass2', requires=IS_EXPR('value==%s' % repr
> > (request.vars.pass1), "Passwords do not match!"),
> > _class="frm_field")),
> > TR("Your City:",INPUT(_type="text",_name="city",
> > _class="frm_field")),
> > TR("How did you hear about us:",SELECT('Select
> > One', 'Search Engine','Advertisment','Word of
> > Mouth','Other',_name="referral",requires=IS_IN_SET(['Search
> > Engine','Advertisment','Word of Mouth','Other']))),
> > TR("", INPUT(_type="submit",_value="Sign-up",
> > _class="form_btn"), _class="aright"), _class="frm_tbl"),
> > _method="post")
>
> > if form.accepts(request.vars,session):
> > redirect(URL(r=request, c='user', f=''))
> > response.flash="form accepted"
>
> > elif db((db.db_users.dbu_email == request.post_vars.email) &
> > (db.db_users.dbu_name == request.post_vars.nick)):
> > response.flash="form is invalid"
>
> > elif form.errors:
> > response.flash="form is invalid"
> > else:
> > response.flash="please fill the form"
>
> > return dict(form=form,vars=form.vars)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---