Home
The Toolkit for Online Communities
15901 Community Members, 0 members online, 2357 visitors today
Log In Register

Web Forms

OpenACS Home : xowiki : Web Forms
Search · Index
Previous Month May 2013
Sun Mon Tue Wed Thu Fri Sat
28 29 30 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 (3) 24 25
26 27 28 29 30 31 1

Popular tags

ad_form , ADP , ajax , aolserver , asynchronous , bgdelivery , bugtracker , COMET , cvs , debian , emacs , FreeBSD , includelets , install , installation , installers , javascript , libthread , linux , monitoring , nginx , oracle , osx , patches , performance , postgres , pound , redhat , selenium , ssl

No registered users in community xowiki
in last 30 minutes

Contributors

OpenACS.org

Web Forms

Web Forms 

Use ad_form to create html forms. If you work on a page that does not, convert it to use ad_form.

You can grep the toolkit under /packages and see many examples. 

Ad_form can handle many of your possible interactions with the system, such as normal tasks as add and edit data, validate entry form data, etc.

Aditional information here:

http://rubick.com:8002/openacs/ad_form

Use the following in the tcl part of a page to limit access to page requests via post.. to reduce vulnerability to url hack and insertion attacks from web:

if { [ad_conn method] != POST } {
ad_script_abort
}

Grouping elements into sections using ad_form

The {-section} list allows to group the subsequent elements (until the next section declaration) into a section. {-section} accepts 4 properties:

 

{-section \
section_id \
{legendtext $legendstring} \
{legend {name value name value ... name value}} \
{fieldset {name value name value ... name value}}
}

where:

Example

ad_form \
-name "your_zen_level" \
-method post -html {enctype multipart/form-data class margin-form} \
-fieldset {{title "T1" class "C1"} "This really works!!"} \
-form {

    # Start section 1
    {-section "sec1" {legendtext "Section Title I"} {legend {class myClass id myId}}}
    {zen_comment:text(comment)\
                 {label "template::widget::comment"}\
                 {value "Please enter your comments."}\
                 {html {rows 7 cols 50}}}
    {zen_file:text(file),optional\
                 {label "template::widget::file"}}

    # Start section2
    {-section "sec2" {legendtext "Section Title II"} {fieldset {class myclass}}}
    {zen_multiselect:text(multiselect)\
                 {label "template::widget::multiselect"}\
                 {options {"mark" "emma" "avni" "carl" "don"}}}

    # Unset the section. subsequent elements will not be in any section.
    {-section ""}
    {zen_text:text(text),optional,nospell\
                 {label "template::widget::text"}\
                 {help_text {"Your identification tag number"}}}
    {zen_textarea:text(textarea),optional,nospell\
                 {label "template::widget::textarea"}\
                 {help_text {"Please describe your desired state of being"}}\
                 {html {rows 7 cols 50}}}
}