Forum OpenACS Q&A: Response to Adding additional HTML into forms

Collapse
Posted by Don Baccus on
You could store the form building snippets in a list that you then reorder. Using ad_form to build it you could do something like

foreach form_element $form_elements {
    ad_form -extend -name your_form_name -form $form_element
}

ad_form -extend -name your_form_name -new_data {
...
} -edit_data {
...
}

(or -on-submit or whatever you do to handle the form submission)

This presumes that you've already put out some initial form information because of the use of -extend.

I've not tried this because, frankly, I hadn't thought about the problem when writing ad_form. But I don't see any reason offhand why it won't work.