Index: openacs-4/packages/acs-templating/www/doc/TclDocs/form.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/TclDocs/form.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/TclDocs/form.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/TclDocs/form.html 19 Jan 2002 23:45:46 -0000 1.2 @@ -18,26 +18,28 @@ Listing of public methods:
- template::form::create
+
- template::form::exists
+
- template::form::export
+
- template::form::get_combined_values
+
- template::form::get_values
+
- template::form::is_request
+
- template::form::is_submission
+
- template::form::is_valid
+
- template::form::section
+
- template::form::set_values
+
+
+

Method Detail

@@ -48,13 +50,13 @@ Public Methods:
+ The form identifier + + + +
- template::form::create +
-Initialize the data structures for a form. +Convenience procedure to set individual values of a form (useful for simple update forms). Typical usage is to query a onerow data source from database and pass the resulting array reference to set_values for setting default values in an update form.
@@ -66,38 +68,25 @@ *
- A keyword identifier for the form, such as { add_user} or { edit_item} . The ID must be unique in the context of a single page.
array_ref + * + + The name of a local array variable whose keys correspond to element identifiers in the form
-
Options: - - - - - - - - - - - -
method - - The standard METHOD attribute to specify in the HTML FORM tag at the beginning of the rendered form. Defaults to POST.
html - - A list of additional name-value attribute pairs to include in the HTML FORM tag at the beginning of the rendered form. Common attributes include JavaScript event handlers and multipart form encoding. For example, { -html { enctype multipart/form-data onSubmit validate() } }
elements - - A block of element specifications.
-

@@ -130,7 +119,7 @@

- template::form::exists +
@@ -151,12 +140,61 @@

- template::form::export +
+ +
- template::form::get_combined_values +
+Initialize the data structures for a form. +
+
+ + Parameters: + + + + + + +
id + * + + A keyword identifier for the form, such as { add_user} or { edit_item} . The ID must be unique in the context of a single page.
+ +
Options: + + + + + + + + + + + +
method + + The standard METHOD attribute to specify in the HTML FORM tag at the beginning of the rendered form. Defaults to POST.
html + + A list of additional name-value attribute pairs to include in the HTML FORM tag at the beginning of the rendered form. Common attributes include JavaScript event handlers and multipart form encoding. For example, { -html { enctype multipart/form-data onSubmit validate() } }
elements + + A block of element specifications.
+ +
+
+ +

+ + +
+ + +
+
Return a list which represents the result of getting combined values from multiple form elements
@@ -194,13 +232,13 @@

- - - -
- template::form::get_values +
-Set local variables for form variables (assume they are all single values). Typically used when processing the form submission to prepare for DML or other type of transaction. +Return the number of elements in a form
@@ -214,13 +252,6 @@ The form identifier
args - * - - A list of element identifiers. If the list is empty, retreive all form elements

@@ -230,13 +261,13 @@

- template::form::is_request +
-Return true if preparing a form for an initial request (as opposed to repreparing a form that is returned to the user due to validation problems). This command is used to conditionally set default values for form elements. +Return true if a submission in progress. The submission may or may not be valid.
@@ -263,13 +294,13 @@

- template::form::is_submission +
-Return true if a submission in progress. The submission may or may not be valid. +Return true if preparing a form for an initial request (as opposed to repreparing a form that is returned to the user due to validation problems). This command is used to conditionally set default values for form elements.
@@ -296,7 +327,7 @@

@@ -329,13 +360,13 @@

- template::form::is_valid +
+ The form identifier - + A list of element identifiers. If the list is empty, retreive all form elements
- template::form::section +
-Set the name of the current section of the form. A form may be divided into any number of sections for layout purposes. Elements are tagged with the current section name as they are added to the form. A form style template may insert a divider in the form whenever the section name changes. +Set local variables for form variables (assume they are all single values). Typically used when processing the form submission to prepare for DML or other type of transaction.
@@ -347,14 +378,14 @@ *
- The form identifier.
section + args * - The name of the current section.
@@ -365,13 +396,13 @@

+ The form identifier. - + The name of the current section.
- template::form::set_values +
-Convenience procedure to set individual values of a form (useful for simple update forms). Typical usage is to query a onerow data source from database and pass the resulting array reference to set_values for setting default values in an update form. +Set the name of the current section of the form. A form may be divided into any number of sections for layout purposes. Elements are tagged with the current section name as they are added to the form. A form style template may insert a divider in the form whenever the section name changes.
@@ -383,14 +414,14 @@ *
- The form identifier
array_ref + section * - The name of a local array variable whose keys correspond to element identifiers in the form
@@ -407,13 +438,13 @@ Private Methods:
+ + + +
- template::form::check_elements +
-Iterates over all declared elements, checking for hidden widgets and rendering those that have not been rendered yet. Called after rendering a custom form template as a debugging aid. +Auto-generate the template for a form
@@ -427,73 +458,73 @@ The form identifier
style + * + + The style template to use when generating the form. Form style templates must be placed in the forms subdirectory of the ATS resources directory.
+

Returns: +
+ A string containing a template for the body of the form. +

- template::form::generate +
-Render the finished HTML output for a dynamic form. +Helper procedure used to access the basic data structures of a form object. Called by several of the form commands.
- Parameters: - - - - - - - - - - -
id - * - - The form identifier
style - * - - The style template to use when generating the form. Form style templates must be placed in the forms subdirectory of the ATS resources directory.
- -
Returns: -
- A string containing the HTML for the body of the form. -

- template::form::get_reference +
-Helper procedure used to access the basic data structures of a form object. Called by several of the form commands. +Iterates over all declared elements, checking for hidden widgets and rendering those that have not been rendered yet. Called after rendering a custom form template as a debugging aid.
+ Parameters: + + + + + + +
id + * + + The form identifier
+

@@ -533,13 +564,13 @@

- template::form::render +
- template::form::template +
-Auto-generate the template for a form +Render the finished HTML output for a dynamic form.
@@ -564,7 +595,7 @@
Returns:
- A string containing a template for the body of the form. + A string containing the HTML for the body of the form.