Forum OpenACS Q&A: Newbie Question - AdForm - Pulling from DB to Create a List

I am making a form using ad-form, and I would like to create a list (pulled form a database) with 2 checkboxes beside each element where a user can select either checkbox options.  Can someone point me in the right direction?

Also, is there a standard list of all elements in ad-form that exist?  I've scanned the documentation to no avail.

I have been successful in pulling from the database and filling an option box with the DB values, so I'm close.

Thanks in advance.

Do you mean checkbox, where a user can select either or both, or radio, where a user can select either but not both? If a checkbox, you will need to handle a potential multi-part response. If it's a radio, here's an example:
form create entry

element create entry draft_p -label "Post Status" -datatype text -widget radio -options { { "Draft" "t" } { "Publish" "f" } }
check out db_list_of_lists
Yes, what I mean is having 2 checkboxes (not radio buttons) beside each database item.  A user would be able to select no options, one of the options, or both of the options.

I am already using the db_list_lists construct as follows:

set programs [db_list_of_lists get_programs "SELECT * FROM programs"]

In the code, I have:

{programs: test(checkbox)
  {label "Whatever"}
  {options {$program_groups} {value $prog_name}}
}

This code snippet works for 1 checkbox, but I want to add another checkbox beside the other one.

Just a thought but you have to be careful about quoting and lists. For example

works
category -label {Category} -datatype text -widget select -options \"$cats\"

does not work (you only get one)
category -label {Category} -datatype text -widget select -options $cats

I don't have the answer, but he asked for ad_form not the deprecated use of templating directly. We really should use ad_form and forget about examples using the templating system directly (I realize there are a few case where this is necessary, but not very often.)