Index: openacs-4/packages/acs-core-docs/www/form-builder.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/form-builder.html,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/acs-core-docs/www/form-builder.html 27 Oct 2014 16:39:18 -0000 1.30 +++ openacs-4/packages/acs-core-docs/www/form-builder.html 7 Aug 2017 23:47:50 -0000 1.31 @@ -1,12 +1,12 @@ -Using Form Builder: building html forms dynamically

Using Form Builder: building html forms dynamically

Overview

($Id$)
+Using Form Builder: building html forms dynamically

Using Form Builder: building html forms dynamically

Overview

($Id$)
OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

OpenACS has a form manager called ad_form. Ad_form has an adaptable UI. Error handling includes inline error reporting, and is customizable. However, ad_form can be tricky to use. In addition to this document, the ad_form api - documentation is helpful.

Multi-part Elements

Some elements have more than one choice, or can submit more than one value.

SELECT elements

  1. Creating the form element. Populate a list of lists with values for the option list.

    set foo_options [db_list_of_lists foo_option_list "
    + documentation is helpful.

Multi-part Elements

Some elements have more than one choice, or can submit more than one value.

SELECT elements

  1. Creating the form element. Populate a 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
    @@ -31,7 +31,7 @@
         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 {[exists_and_not_null pm_task_id]} {
    +    

        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 @@ -44,12 +44,12 @@ Asher):

     ns_log notice it's my page!
     set mypage [ns_getform]
    -if {[string equal "" $mypage]} {
    +if {$mypage eq ""} {
         ns_log notice no form was submitted on my page
     } else {
         ns_log notice the following form was submitted on my page
         ns_set print $mypage
     }
         

Tips for form widgets

Here are some tips for dealing with some of the form widgets:

Current widget

Common Errors

Here are some common errors and what to do when you - encounter them:

Error when selecting values

This generally happens when there is an error in your - query.

View comments on this page at openacs.org
+ encounter them:

Error when selecting values

This generally happens when there is an error in your + query.