Forum OpenACS Development: Re: ad_form all over the place?

Collapse
Posted by Jon Griffin on
My doc is accurate, but there are some additions that could be made.

As usual the problem is time. I will try to add some of the things that I now know as well as some things Dave B has done in the near future.

Collapse
Posted by Tilmann Singer on
Tom, isn't the fact that you can switch off the form builders html generation by inserting your own html inside the <formtemplate></formtemplate> tags exactly what you need?

I had to deal a few times with forms that were pre-produced by designers in a way that would not be automatically producable because they were not really systematic, so I just replaced their <form> tag with <formtemplate>, and their <input foo="x" bar="y"> with <formwidget foo="x" bar="y"> and after that I was able to benefit from input validation and all other functionalities of ad_form, while maintaining exactly the look that the designers intended. That obviously has the drawback that when you do changes to the fields you also need to edit the adp file but this is of course inavoidable.

You also need to add <formerror> tags for positioning the "wrong input" error messages near the fields that caused them, and it becomes a little tricky when you want to only display certain formatting tags in case of an error (e.g. <font color="red">Wrong Input</font>), but it's certainly possible.