View · Index

Unit 3 / Using the Form Builder ::Generic::Form (2)

# still in file xotcl-demo-note/www/admin/edit.tcl

#
# Provide a form + field specification


::Generic::Form create form1 -volatile  -data $item  -fields {
      {item_id:key}
      {name:text {label Name}}
      {number:text {label Number}}
      {text:richtext(richtext),nospell,optional {label Content} {options {editor xinha}}}
      {description:text(textarea),nospell,optional {label Description}
        {html {cols 60 rows 2}}
      }
    }

form1 generate
# provide values for edit.adp
form1 instvar context formTemplate
set title "My first Form"