Search code examples
formscheckboxyamltypo3-9.x

TYPO3 Ext:form Checkbox Label with Link inside


I'm using the latest TYPO3 9.5.13 and made an contact form with the new form system extension: form

I need a checkbox before Submit button, f.e. "I've read the privacy policy .. " I've found this extension, because this is not working out of the box. https://github.com/tritum/form_element_linked_checkbox (installed via composer the latest master 1.1.0)

I can't create a Text like this: "Yes, I've read the privacy policy and blahablah .." The link is always at the end of the label. I've made it like they shown in the description of the extension form-element-linked-checkbox. Have I forget something? Here's my YAML

  -
    type: LinkedCheckbox
    identifier: linkedcheckbox-1
    label: ' Ja, ich habe die %s gelesen und bin mit der Verarbeitung meiner Daten einverstanden.'
    properties:
      pageUid: '17'
      linkText: Datenschutzhinweise
      elementDescription:
      fluidAdditionalAttributes:
        required: required
    validators:
      -
        identifier: NotEmpty

my result in frontend:

frontend ext:form linked checkbox


Solution

  • I was blind!!! Damn! Sorry, for my stupid error. I forgot the ' ' at labelText, see below:

      -
        type: LinkedCheckbox
        identifier: linkedcheckbox-1
        label: ' Ja, ich habe die %s gelesen und bin mit der Verarbeitung meiner Daten einverstanden.'
        properties:
          pageUid: '17'
          linkText: 'Datenschutzhinweise'
          elementDescription:
          fluidAdditionalAttributes:
            required: required
        validators:
          -
            identifier: NotEmpty