Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 26 Feb 2004 15:28:54 -0000 1.47 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 10 Mar 2004 10:13:47 -0000 1.48 @@ -33,6 +33,33 @@

+

+ + Important note about how ad_form works: ad_form operates in two modes: +
    +
  1. Declaring the form +
  2. Executing the form +
+ Through the -extend switch, you can declare the form in multiple steps, adding elements. + But as soon as you add an action block (on_submit, after_submit, new_data, edit_data, etc.), + ad_form will consider the form complete, and execute the form, meaning validating element values, + and executing the action blocks. The execution will happen automatically the first time you + call ad_form with an action block, and after that point, you cannot -extend the form later. + Also, if you don't supply any action blocks at all, the form will never be considered finished, + and thus validation will not get executed. Instead, you will get an error when the form is rendered. + +

+ + Bottom line: +

    +
  1. You must always have at least one action block, even if it's just -on_submit { }. +
  2. You cannot extend the form after you've supplied any action block. +
+ +
+ +

+ In order to make it possible to use ad_form to build common form snippets within procs, code blocks are executed at the current template parse level. This is necessary if validate and similar blocks are to have access to the form's contents but may cause surprises for the