On 27 ago, 23:27, "mr.freeze" <
nat...@freezable.com> wrote:
> I'm not sure why it's always on but you can store the state of the
> checkbox in a hidden field and pass it back with the ajax request like
> so:
>
> def search2():
> form = FORM(
> TABLE(
> TR(INPUT(_name='mytxt', _id='mytxt', _value='a
> text...')),
> TR(INPUT(_type='checkbox', _name='mychk',
> _id='mychk',_checked="true",_onclick="jQuery('#chkval').val
> (this.checked)")),
> TR(INPUT
> (_type='hidden',_name='chkval',_id='chkval')),
> TR(INPUT(_type="button", _value="Buscar",
> _onclick="ajax('%s',['mytxt',
> 'mychk','chkval'],'target');" % URL(r=request,f='bg_find2')))
> )
> )
>
> return dict(form=form, target=DIV(_id='target'))
>
> def bg_find2():
> return request.var.chkval
>