Forum OpenACS Development: Response to ad_form documentation

Collapse
Posted by Ola Hansson on
Jon, here is some feedback to start you off:

Elements take the form of:
element-name:type(widget)  # should probably be element_name 😉

You should say:

if {[ad_form_new_p -key category_id]} {
  ...

instead of:

if {[info exists category_id]} {

(and have the new and edit block switch location with one another)

Your current example will not show the correct title, etc., if validation fails, you know.

Should you mention that "-name new_category" in the -form block is optional..? I dunno, perhaps it's good to always specify a form name even though it's not always necessery.

And, I remember that I was held up for half an hour, not realizing that the following must be on one line:

} -select_query_name category_select -new_data {

It may be worth mentioning that...