Sample definition of ad_form
ad_form \
-name task \
-cancel_url $return_url \
-action $action_url \
-actions $actions \
-has_edit 1 \
-mode $form_mode \
-export {next_url user_id return_url} \
-form {
task_id:key
{task_name:text(text) {label "[_ intranet-timesheet2-tasks.Name]"} {html {size 50}} {help_text $full_name_help}}
{task_nr:text(text) {label "[_ intranet-timesheet2-tasks.Short_Name]"} {html {size 30}} {help_text $short_name_help}}
{project_id:text(select) {label "[_ intranet-core.Project]"} {options $parent_project_options} {help_text $project_help}}
{material_id:text(select) {label "[_ intranet-timesheet2-tasks.Material]"} {options $material_options} {help_text $material_help}}
{cost_center_id:text(select),optional {label "[_ intranet-timesheet2-tasks.Cost_Center]"} {options $cost_center_options} {help_text $cost_center_help}}
{task_type_id:text(hidden) {label "[_ intranet-timesheet2-tasks.Type]"} {options $type_options} }
{task_status_id:text(im_category_tree) {label "[_ intranet-timesheet2-tasks.Status]"} {custom {category_type "Intranet Project Status"}}}
{uom_id:text(select) {label "[_ intranet-timesheet2-tasks.UoM]
([_ intranet-timesheet2-tasks.Unit_of_Measure])"} {options $uom_options}}
}
Sample definition of template::form
template::form::create $form_id
template::form::section $form_id ""
template::element::create $form_id project_id -widget "hidden"
template::element::create $form_id supervisor_id -widget "hidden" -optional
template::element::create $form_id workflow_case_id -widget "hidden" -optional
template::element::create $form_id requires_report_p -widget "hidden" -optional -datatype text
template::element::create $form_id workflow_key -widget "hidden" -optional -datatype text
template::element::create $form_id return_url \
-widget "hidden" \
-optional \
-datatype text
template::element::create $form_id project_name \
-datatype text\
-label "[_ intranet-core.Project_Name]" \
-html {size 40} \
-after_html "[im_gif help "Please enter any suitable name for the project. The name must be unique."]"