On May 13, 5:23 pm, Andrew Evans <[email protected]> wrote:
> hello I have a form I would like to use multiple check boxes to select
> data to use. I am not using any sql
>
> an example of how I am generating the check boxes
>
> TR(INPUT(_type="checkbox", name="browser"), "Browser"),
> TR(INPUT(_type="checkbox", name="pageDepth"), "Page Depth"),
form=SQLFORM.factory(
Field('browser', 'boolean'),
Field('pagedepth', 'boolean')
)
>
> this is not the best way from what I can tell. How can I generate my
> form values the best way?
>
> also
>
> my other problem is in verifying if the check box has been checked
you can check either request.vars or after accepts form.vars :
if request.vars.browser: ...
#after accepts
if form.vars.browser: ...
> first I do this in the form function
>
> session.browser = form.vars.browser
> session.pageDepth = form.vars.pageDepth
>
> then I am trying to use has_key in my logic function but it always
> returns true
>
> if session.has_key("browser"):
> myDimensions.append("browser")
>
> Any ideas would be appreciated Cheers
>
> :D
>
> Andrew