Index: openacs-4/packages/acs-templating/www/doc/TclDocs/form.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/TclDocs/form.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/doc/TclDocs/form.adp 27 Oct 2014 16:40:16 -0000 1.2 +++ openacs-4/packages/acs-templating/www/doc/TclDocs/form.adp 7 Aug 2017 23:48:02 -0000 1.3 @@ -2,21 +2,28 @@ {/doc/acs-templating {Templating}} {} +

Namespace form

+
Commands for managing dynamic templated +forms.
+

Method Summary

- -

Namespace form

Commands for managing dynamic templated -forms.

Method Summary

-Listing of public methods:
+Listing of public methods:
+











-

Method Detail

-* indicates required

Public Methods:
+ +

Method Detail

+

+* indicates required

+Public Methods: +
+
-
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.
-Parameters: +Parameters:
id* @@ -30,41 +37,44 @@
+
+ -
Determine whether a form exists by checking for its data structures.
-Parameters: +Parameters:
id* The ID of an ATS form object.
-
Returns:
1 if a form with the specified ID exists. 0 if it does +
Returns:
1 if a form with the specified ID exists. 0 if it does not.
+
+ -
Generates hidden input tags for all values in a form submission. Typically used to create a confirmation page following an initial submission.
-
Returns:
A string containing hidden input tags for inclusion in a +
Returns:
A string containing hidden input tags for inclusion in a form.
+
+ -
Initialize the data structures for a form.
-Parameters: +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:
+
Options:
methodThe standard METHOD attribute to specify in the HTML FORM tag at the beginning of the rendered form. Defaults to @@ -81,11 +91,12 @@
+
+ -
Return a list which represents the result of getting combined values from multiple form elements
-Parameters: +Parameters:
id* @@ -104,66 +115,71 @@
+
+ -
Return the number of elements in a form
-Parameters: +Parameters:
id* The form identifier
+
+ -
Return true if a submission in progress. The submission may or may not be valid.
-Parameters: +Parameters:
id* The form identifier
-
Returns:
1 if true or 0 if false
+
Returns:
1 if true or 0 if false
+
+ -
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.
-Parameters: +Parameters:
id* The form identifier
-
Returns:
1 if true or 0 if false
+
Returns:
1 if true or 0 if false
+
+ -
Return true if submission in progress and submission was valid. Typically used to conditionally execute DML and redirect to the next page, as opposed to returning the form back to the user to report validation errors.
-Parameters: +Parameters:
id* The form identifier
-
Returns:
1 if true or 0 if false
+
Returns:
1 if true or 0 if false
+
+ -
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.
-Parameters: +Parameters:
id* @@ -177,14 +193,15 @@
+
+ -
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.
-Parameters: +Parameters:
id* @@ -197,13 +214,15 @@

-Private Methods:
-

+
+

+Private Methods:
+

+ -
Auto-generate the template for a form
-Parameters: +Parameters:
id* @@ -216,32 +235,35 @@ of the ATS resources directory.
-
Returns:
A string containing a template for the body of the form.
+
Returns:
A string containing a template for the body of the form.
+
+ -
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: +Parameters:
id* The form identifier
+
+ -
Render the HTML FORM tag along with a hidden element that identifies the form object.
-Parameters: +Parameters:
id* @@ -253,15 +275,16 @@ the FORM tag, such as JavaScript event handlers.
-
Returns:
A string containing the rendered tags.
+
Returns:
A string containing the rendered tags.
+
+ -
Render the finished HTML output for a dynamic form.
-Parameters: +Parameters:
id* @@ -274,9 +297,9 @@ of the ATS resources directory.
-
Returns:
A string containing the HTML for the body of the form.
+
Returns:
A string containing the HTML for the body of the form.

+ +

* indicates required

-