Forum OpenACS Q&A: ad_form and checkboxes

Collapse
Posted by Mitchel Humpherys on
Does anyone know of any documentation on doing checkboxes in ad_form without having to make a separate element for each and every one (thus having to make a separate field in the database for each checkbox)? I've searched all over but can't find anything on it...
Collapse
2: Re: ad_form and checkboxes (response to 1)
Posted by Dave Bauer on
See, first of all the ad_form api documentation
sepcifically
the part on available datatypes, available widgets, and form element parameters and values
Here is an example

ad_form -name myform -form {
{myelement:text(checkbox),multiple,optional {options { {One 1} {Two 2} } } }
}

The variable myelement will contain a list of values that where checked in the processing code block for ad_form (ie: on_submit, new_data, edit_data)

Collapse
3: Re: ad_form and checkboxes (response to 2)
Posted by Mitchel Humpherys on
Works just like you said! Thanks so much!