The form is not accepted when it is first created, so you will always get 
that error message. Instead, you want:

    elif form.errors:
        response.flash = 'There was an error..'

Anthony

On Monday, December 30, 2013 10:21:58 AM UTC-5, Avi A wrote:
>
> Hi,
> I have this on the view:
>
> <div>
>    <input name="name" onkeyup="ajax('org_form_load.load', ['name'], 
> 'org_form_target')" />
> </div>
> <div id = "org_form_target"></div>
>
> and something like this on the controller:
>
> def org_form_load():
>     org_code = request.vars.name
>     org_code_name = db(......).select(..............)
>     if org_code_name:
>         db.t_org_members.f_org_member.default = auth.user.id
>         form = 
> SQLFORM(db.t_org_members,onupdate=auth.archive,submit_button= 
> 'something.......')
>         if form.process().accepted:
>             response.flash = 'Success!'
>         else:
>             response.flash = 'There was an error..'
>         return dict(form = form, org_code_name = org_code_name)
> and on the org_form_load:
>
> {{=form}}
>
>
>
> (Before moving the form into the load page, everything went fine.)
> After moving the form to the load page, this is what it does:
> User fill correctly the organization code.
> The form appears as expected, (but not submitted yet)
> BUT I already get the " response.flash = 'There was an error..'".
> If I try to submit the form nothing flashes and form is not submitted 
> either.
> Help please...
> Thanks.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to