Index: openacs-4/packages/acs-core-docs/www/form-builder.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/form-builder.adp,v
diff -u -r1.4.2.4 -r1.4.2.5
--- openacs-4/packages/acs-core-docs/www/form-builder.adp 26 Aug 2020 07:46:25 -0000 1.4.2.4
+++ openacs-4/packages/acs-core-docs/www/form-builder.adp 3 Sep 2021 09:15:00 -0000 1.4.2.5
@@ -1,5 +1,5 @@
- Some elements have more than one choice, or can submit more than
one value.
Creating the form element. Populate a list
-of lists with values for the option list. A situation you may run into often is where you want to pull in
form items from a sub-category when the first category is selected.
Ad_form makes this fairly easy to do. In the definition of your
-form element, include an HTML section
-set foo_options [db_list_of_lists foo_option_list "
+of lists with values for the option list.
set foo_options [db_list_of_lists foo_option_list "
select foo,
foo_id
from foos
@@ -54,8 +53,7 @@
refreshes to pull additional information from the database
-{pm_task_id:integer(select),optional
+form element, include an HTML section
{pm_task_id:integer(select),optional {label "Subject"} {options {$task_options}} {html {onChange "document.form_name.__refreshing_p.value='1';submit()"}} @@ -64,8 +62,7 @@
What this will do is set the value for pm_task_id and all the other form elements, and resubmit the form. If you then include a block that extends the form, you'll have the opportunity to add -in subcategories:
-if {[info exists pm_task_id] && $pm_task_id ne ""} { +in subcategories:if {[info exists pm_task_id] && $pm_task_id ne ""} { db_1row get_task_values { } ad_form -extend -name form_name -form { ... }Note that you will get strange results when you try to set the @@ -99,7 +96,7 @@ Errors
Here are some common errors and what to do when you encounter them:
This generally happens when there is an error in your query.