ayhan
ayhan

Reputation: 25

TYPO3 TCA and select form

I try to get values for my tca:

'config' => [
    'type' => 'select',
    'renderType' => 'selectSingle',
    'items' => [
        ['Herr', 0],
        ['Frau', 1]
    ],
    'size' => 1,
    'maxitems' => 2,
    'eval' => 'required'
],

my form.html has this select types:

<label>Anrede</label>
<f:form.select name="salutation" class="form-control">
    <f:form.select.option value="0">Herr</f:form.select.option>
    <f:form.select.option value="1">Frau</f:form.select.option>
</f:form.select>

but i get always the first item: Herr, can somebody tell me what i am doing wrong?

Upvotes: 0

Views: 579

Answers (1)

Jo Hasenau
Jo Hasenau

Reputation: 2684

For frontend forms with Extbase you will need a proper TypoScript conffiguration, a PHP newAction and/or createAction method and your Fluid template.

Based on the additional information now there are two options that came to my mind:

  • Either the validation and storage of your form values is not configured properly, so they will be removed on the way to the database.
  • Or you might have rendered the field twice with the same name in the frontend form, thus making the last entry the winner.

So please double check the fields first before digging deeper into the storage process.

https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/7-Controllers/1-Creating-Controllers-and-Actions.html

Upvotes: 0

Related Questions