[web2py] Re: check boxes with is_in_set

2016-12-13 Thread 黄祥
it's work now, even in the tuple inside the list data type, my bad to treat the list data type in an unproper manner, hehe *is_in_set list checkboxes refer to rows table database * *e.g.* def attendance_form(): target_response = "jQuery('#attendance_checkout').get(0).reload()" rows_list_employee

[web2py] Re: check boxes with is_in_set

2016-12-12 Thread Jim Russell
In your example, list_chart is not a list of strings, it is a list of tuples. In my code, hostnames is just a list of hostnames. e.g. ('hostname1.example.com','hostname2.example.com') I assume that you are trying to make the checkboxes default to true. For me, they defaulted to being checked.

[web2py] Re: check boxes with is_in_set

2016-12-12 Thread 黄祥
trying the tricks but got error when the checkbox is empty (1 or all checkbox is empty, when all checkbox is on its work) : *e.g.* def test_form(): redirect_url = 'test' list_chart = [(True, 'line'), (True, 'pie'), (True, 'bar') ] form = SQLFORM.factory( Field('chart', 'list:string', defau

[web2py] Re: check boxes with is_in_set

2016-12-08 Thread Jim Russell
Rob, I used this code to get a list with checkboxes. form=SQLFORM.factory( Field('hostnames',"list:string", default=hostnames,widget=SQLFORM.widgets.checkboxes.widget,requires=[IS_IN_SET(hostnames,multiple=True),IS_NOT_EMPTY()])) hostnames is a list containing strings. -- Resource