Forum OpenACS Q&A: How to customize ad_form's HTML
I know that with OpenACS 4 there was ad_form and, in the adp file, the form wasn't build automatically but you had to code every field of the form. Instead now just put
<\formtemplate\>and it's done by itself.
I always used that, but now i have the need to customize the form and put, for example, two filelds on the same row instead of one on top of the other.
Does anybody have some examples?
Thank you in advance,
All the best.
you can place the widgets created with ad_form in your adp file, using the Tag <formwidget id="element_name"/> for single inputs like Textfields, and <formgroup id="element_name"></formgroup> (which is like a <multiple name="..">) for sets of inputs like Radio Buttons or Checkboxes. To display a widgets error message, if for example a data type check failed after the form was submitted, place <formerror id="element_name"></formerror> into the adp. All widget Tags must be nested within the <formtemplate id="your_form"></formtemplate> Tag of the form they belong to.
here is a little example:
<td colspan="2" align="left">
<td align="left" colspan="2">
MESSAGE KEY MISSING: 'accommodation.order_register_for_news_letter'
I hope this helps,