terminal42 / contao-conditionalformfields

Display form fields conditionally in Contao Open Source CMS
MIT License
18 stars 12 forks source link

Data of previous steps get lost with contao-mp_forms and contao-ajaxform #48

Closed markus361 closed 2 years ago

markus361 commented 3 years ago

Contao: 4.4.46 contao-conditionalformfields: 2.3.3 contao-mp_forms: 4.1.0 contao-ajaxform: 1.1.1

In my example: On step 2 there are 2 radios On step 3 there is a fieldset with ConditionalFormField activated, which checks those radios

Now when on step 3 there is no data from step 2 available and the condition is not working on the fieldset.

In the conditionalformfields.js file on line 117 I added console.log($this.fields); the object is empty when on step 3

EDIT contao-ajaxform not necessarily required

aschempp commented 2 years ago

Version 3 is a complete rewrite, maybe it works now. Since I don't use the combination of extension, feel free to provide a pull request that fixes the issue for you 🙃