When you need several validators on a field you create a list of them:

... requires=[ IS_NOT_EMPTY(), IS_LENGTH(50) ]

Denes

On Sunday, January 17, 2016 at 4:22:38 PM UTC-5, Alessio Varalta wrote:
>
> Hi I have a problem with filed and validate
>
>             
> Field('nome',),type="string",length=50,requires=IS_NOT_EMPTY()),
> I generate a sqlform grid and when i add new element and try to compile 
> requires is not empty work but not length=50 if i eliminate requires is not 
> empty i have that length work...How does to have the two controll together?
>
> I have another important question, If I send the data throught Javascript 
> and insert this data with a query for example 
> db(db.nome.id=2).insert(nome=request.vars.nome) 
> there is a exception if the user insert too text?
>

-- 
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/d/optout.

Reply via email to