Issue Bug Closed

#70502EXT:form - selected attribute not rendered

Björn Jacob 10/08/15, 16:11 updated 10/21/17, 17:43

Description

Setting up the following form:

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
}

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.

Reviews 1