Bug #70502
Updated by Björn Jacob over 9 years ago
Setting up the following form:
<pre>
<code>
enctype = multipart/form-data
method = post
novalidate = novalidate
prefix = tx_form
confirmation = 1
postProcessor {
1 = mail
1 {
recipientEmail = your@email.com
senderEmail = your@email.com
}
}
10 = TEXTLINE
10 {
autofocus = autofocus
name = surname
placeholder = Surname
label {
value = Surname
}
}
20 = CHECKBOX
20 {
checked = checked
name = checkbox1
value = checkbox2
label {
value = Checkbox1
}
}
30 = SELECT
30 {
multiple = multiple
name = select1
label {
value = Select
}
10 = OPTION
10 {
data = Option 1
selected = selected
value = Value1
}
20 = OPTION
20 {
data = Option 2
value = Value2
}
30 = OPTION
30 {
data = Option 3
selected = selected
value = Value3
}
}
40 = SUBMIT
40 {
name = 5
type = submit
value = Submit form
}
</code>
</pre>
The form adds a SELECT element with 3 options where 2 of them should be selected by default. Viewing the form in the frontend the selected attribute(s) are not rendered. It does not matter if only one or more options should be selected. The attribute multiple is not a problem. It happens in any case.