mardi 27 septembre 2016

Typoscript: formhandler postprocessor using if

I have a multistep form (using formhandler) that uses 2 checkboxes in 1st step. From those checkboxes, one of the finishers would be used to create text, depending on user selections according to code below:

TextSelected.mapping = COA
TextSelected.mapping {
    10 = TEXT
    10.value = Selected options
    10.noTrimWrap = ||: |
    15 = TEXT
    15.value = option 1
    15.if {
        isTrue.data = GP:checkbox|option|0
    }
    20 = TEXT
    20.value = and
    20.noTrimWrap = | | |
    20.if {
        isTrue.data = GP:checkbox|option|0
        isTrue.data = GP:checkbox|option|1
    }
    25 = TEXT
    25.value = option 2
    25.if {
        isTrue.data = GP:checkbox|option|1
    }
}

So, as example, if the 2 checkboxes are checked, text would result in "Selected options: option 1 and option 2".

This works fine if only one step is used. However, when more steps must be applied, such code does not work at all. According to documentation, we should use .sanitize to get data stored in sessions for such cases, as the checkboxes data is stored that way as they are shown in first step. So my question is: - how can apply .sanitize to my code - or some other similar solution - so the conditions could work in multistep form?

I'm using Typo3 v6.2.25 and Formhandler v2.0.2

Thanks in advance, FO




Aucun commentaire:

Enregistrer un commentaire