Because in request.vars just contains the POST variables and the HTTP protocol cannot distinguish a single checkbox from a normal input. If you look into form.vars.checkbox you find it is always a list. The form knows this is a checkbox, the request objects does not.
On Tuesday, 2 October 2012 14:30:14 UTC-5, andrej burja wrote: > > hi > > i have SQLFORM with checkboxes (widget). > if i choose one checkbox, type(request.varst.checkbox) is 'string' > and if i choose more than one checkbox, tpye(request.vars.checkbox) is > 'list' > why choosing one checkbox does not return 'list'? > > > form = SQLFORM.factory(Field('checkbox','list:string',label=T('Equipment' > ),requires=IS_EMPTY_OR(IS_IN_SET(some_set,multiple=True)), > widget=SQLFORM.widgets.checkboxes. > widget) > > andrej > > --