list_show_0 = [('test0', T('Test0') ), 
             ('test1', T('Test1') ) ]

form_field_checkbox = lambda list_show, name: \
    #DIV(*[DIV(INPUT(_type = 'checkbox', _value = value, _name = name), 
LABEL(label) ) for value, label in list_show], requires = IS_NOT_EMPTY() )
    #DIV(*[DIV(INPUT(_type = 'checkbox', _value = value, _name = name), 
LABEL(label), requires = IS_NOT_EMPTY() ) for value, label in list_show] )
    DIV(*[DIV(INPUT(_type = 'checkbox', _value = value, _name = name, 
requires = IS_NOT_EMPTY() ), LABEL(label) ) for value, label in list_show] )

#no error occured but the result is not expected, the requires = 
IS_NOT_EMPTY() not work

form_field_select = lambda: \
    DIV(SELECT(_name = 'test', OPTION('Choose One'), 
    *[OPTION('%s' % (show), _value = str(value) ) for value, show in 
list_show_0] ) )

"""
return an error 
DIV(SELECT(_name = 'test', OPTION('Choose One'),
SyntaxError: non-keyword arg after keyword arg
"""

form_field_date = lambda name, placeholder: \
DIV(INPUT(_type = 'text', _name = name, _autocomplete = 'off', _class = 
'date form-control'), 
 requires = IS_DATE() )

#no error occured but the result is not expected, the requires = IS_DATE() 
not work

- it seems some of requires validation is not work when using FORM()

just curious, because in some thread in this group said that the future 
will use FORM(), not sure what will happen with SQLFORM(), is it going 
deprecated like CRUD() ?

thanks and best regards,
stifan

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to