make_form_code

one of the documented procedures in this installation of the ACS
Usage:
make_form_code   column   form_type   prompt   eione   eitwo   eithree
What it does:
The top-level procedure to make a form for the edit page code. Goes through the form types and calls helper proc handle-{form-types} for each form_type
Defined in: /web/philip/tcl/prototype-defs.tcl

Source code:


    upvar table_name table_name
    set form_html "<tr><th valign=top align=right>$prompt</th>\n"
    switch $form_type {
        textbox {append form_html [code_for_textbox $column $eione $eitwo] }
        textarea {append form_html [code_for_textarea $column $eione $eitwo $eithree] }
        radiobutton {append form_html [code_for_radio $column $eione $eione] "</tr>\n\n"}
        checkbox {append form_html [code_for_checkbox $column $eione $eione] "</tr>\n\n"}
        select {append form_html [code_for_select $column $eione $eione] "</tr>\n\n"}
        boolean {
            if [string compare $eione "tf"] {
                append form_html [code_for_radio $column {t f} {Yes No}] "</tr>\n\n"
            } else {
                append form_html [code_for_radio $column {t f} {True False}] "</tr>\n\n"
            }   
        }
        date {
            append form_html "\"\n"
            append form_html "if \[empty_string_p \$$column\] \{"
            append form_html "\n    ns_write \"<td>No date in the database. Set a date: &nbsp;"
            append form_html "\n    \[philg_dateentrywidget_default_to_today $column\]</td></tr>\n\n"
            append form_html "\"\n\} else \{\n    ns_write \""
            append form_html "<td>\[philg_dateentrywidget $column \$$column\]</td></tr>\n\n"
            append form_html "\"\n\}\n\nns_write \""
        }
        default {
            append form_html "<input type=text size=50 name=$column><p>\n"
        }
    }
    return $form_html


philg@mit.edu