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

Collapse
Posted by Andrew Zeon on
Is there a way I can define a new element type? For example, I want to have a line like this is my tcl file:

element create cal_item section1_heading -datatype text -widget heading -option "Section 1" -html {bold underline}

All this would do is put a heading on the form. Really long forms would be sub-divided into sections and you could have a section heading for each section. It would be pretty foolish to have to write the whole template out again when all you want is to put headings so that your form may be divided into sections.

In the template file, you would do something like this:


if @elements.widget@ eq heading>
   formwidget id="section1_heading"
/if>



It there are any mechanisms that already exist that allows you to do such a thing, then please let me know.

Thanks.