FORM¶
A form will always start with the FORM object. TYPO3 recognizes this object and sends all TypoScript data to the FORM extension.
accept-charset¶
- Description:
- See general information for accept-charset.
postProcessor¶
- Description:
- See general information for postProcessor.
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
}
}