Is it possible that your browser isn't accepting cookies, or that you are 
somehow clearing the session? Without cookies, the session won't work, and 
by default, SQLFORM uses the session to store the _formkey token to protect 
against CSRF attacks. To see if that's the problem, you can try:

if form.process(session=None).accepted:

With session=None, it won't use the session (and therefore won't protect 
against CSRF). If it works in that case, then there's a problem with the 
session cookie and/or session.

Anthony

On Sunday, April 7, 2013 11:41:02 PM UTC-4, Nguyen Minh Tuan wrote:
>
> Thanks Anthony,
> When I submit with blank data, no error msg displayed.
> I expected error msg displayed because I set this field mandatory as below
>
> db.define_table('person', Field('personname', 'string', requires = 
> IS_NOT_EMPTY()))
>
> I found that :   if form.process().accepted:   always return false, so 
> redirect command never reached.
> The 
>
> elseif :
>      response.flash = "input info"
>
> always run, so page and flash "input info" are displayed again 
>
> Regards,
> Tuan.
>
> On Friday, April 5, 2013 8:22:50 PM UTC+7, Anthony wrote:
>>
>>         redirect('default', 'list')
>>
>>
>> Should be:
>>
>> redirect(URL('default', 'list'))
>>
>> When I submit form with empty value (person name), validation does not 
>>> work.
>>>
>>
>> What do you mean it doesn't work? Do you not see the error message on the 
>> form? What do you expect, and what happens instead? It works when I try the 
>> code? 
>>
>> Anthony
>>
>

-- 

--- 
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