## Form Element

Templating System : API Reference

### Summary

### Methods

    template::element create form_name element_name \
                            -widget widget \
                            -datatype datatype \
                            -html { attribute value attribute value ... } \
                            -validate { \
                              name { expression } { message } \
                              name { expression } { message } \
                              ... } \
                            -options { { label value } { label value } ... } \
                            -maxlength maxlength \
                            -value value \
                            -values { value value ... }

Append a new element to the specified form.

- The `html` switch may be used to include additional HTML attributes in the `input`, `select`, or `textarea` tag used to ultimately render the element.
- The `validate` switch may be used to perform simple custom validation of each element value. `type` is a keyword for the type of validation being performed. This same keyword must be referenced by the `formerror` tag to customize the presentation and layout of the error message for this validation step. `expression` must be a block of arbitrary Tcl code that evaluates to 1 (valid) or 0 (not valid). The variable `$value` may be used in the expression to reference the element value. `message` is simply a string containing a message to return to the user if validation fails. The variables `$value` and `$label` may be used in the message to reference the parameter value and label (or name if no label is supplied).

    template::element set_properties form_name element_name

    template::element get_value form_name element_name

### Example

    template::element get_values form_name element_name

### Note(s)

templating@arsdigita.com