if form.acceps(request.vars,session):
     (...)
else:
     (...)
_____________________________________________
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/2/28 Lennon <lpru...@hotmail.com>

> I think I must be missing something obvious.
>
> The form displays correctly and populates with the record/data that I
> want it to populate with.  But when I hit the submit button, it won't
> run the code under "if form.accepts".  It just reloads the page with
> the same form and record and no insert has been done or error message
> given.
>
> rows = db(db.traveler_template.user_id == session.user['id']).select()
> record = rows[0]
> form = SQLFORM.factory(db.traveler_template,record=record)
>
> if form.accepts(request.vars, session):
>        #check whether the form had errors
>        if form.errors:
>            response.flash = 'Form has errors'
>            return dict(form=form)
>        else:
>           #insert the record
>           | Insert Code Omitted |
>
> return dict(form=form)
>
> I also tried
>
> if form.accepts(request.vars):
>
> to no avail.
>
> Also, I'm using the {{=form.custom.begin}} type syntax to display the
> form.  Could that have something to do with it?

Reply via email to