FORM

A form will always start with the FORM object. TYPO3 recognizes this object and sends all TypoScript data to the FORM extension.

accept

Description:
See general information for accept.

accept-charset

Description:
See general information for accept-charset.

action

Description:
See general information for action.

class

Description:
See general information for class.

dir

Description:
See general information for dir.

enctype

Description:
See general information for enctype.

id

Description:
See general information for id.

lang

Description:
See general information for lang.

layout

Description:
See general information for Layout and the form specific information.

method

Description:
See general information for method.

name

Description:
See general information for name.

postProcessor

Description:
See general information for postProcessor.

prefix

Description:
See general information for prefix.

rules

Description:
See general information for rules.

style

Description:
See general information for style.

title

Description:
See general information for title.

[tsref:(cObject).FORM]

Example

This example shows a simple payment form. At the beginning the layout of the radio buttons is changed for the form view. The label and the input field are switched.

The example builds a form as TypoScript library which can be assigned to a marker or used inside a fluid template. The defined layout settings are only valid within this TS library.

lib.form = FORM
lib.form {
  method = post

  postProcessor {
    # ...
  }

  form {
    layout {
      radio (
        <input />
        <label />
      )
    }
  }

  10 = FIELDSET
  10 {
    legend = Name

    10 = SELECT
    10 {
      label = Title

      10 = OPTION
      10 {
        data = Mr.
        selected = 1
      }

      20 = OPTION
      20 {
        data = Mrs.
      }

      30 = OPTION
      30 {
        data = Ms.
      }

      40 = OPTION
      40 {
        data = Dr.
      }

      50 = OPTION
      50 {
        data = Viscount
      }
    }

    20 = TEXTLINE
    20 {
      label = First name
    }

    30 = TEXTLINE
    30 {
      label = Last name
    }
  }

  20 = FIELDSET
  20 {
    legend = Address

    10 = TEXTLINE
    10 {
      label = Street
    }

    20 = TEXTLINE
    20 {
      label = City
    }

    30 = TEXTLINE
    30 {
      label = State
    }

    40 = TEXTLINE
    40 {
      label = ZIP code
    }
  }

  30 = FIELDSET
  30 {
    legend = Payment details

    10 = FIELDSET
    10 {
      legend = Credit card

      10 = RADIO
      10 {
        label = American Express
        name = creditcard
      }

      20 = RADIO
      20 {
        label = Mastercard
        name = creditcard
      }

      30 = RADIO
      30 {
        label = Visa
        name = creditcard
      }

      40 = RADIO
      40 {
        label = Blockbuster Card
        name = creditcard
      }
    }

    20 = TEXTLINE
    20 {
      label = Card number
    }

    30 = TEXTLINE
    30 {
      label = Expiry date
    }
  }

  40 = SUBMIT
  40 {
    value = Submit my details
  }
}