more values for variable

Add multiple values to a dropdown field based on conditions.

Overview

The dropdown field needs to display multiple selectable values when multiple conditions are true, but the data builder only sets a single value.
Use a PHP action to append new values to the existing variable instead of replacing it.

Answered
ChronoForms v6
al alexatr 22 Jan, 2020
i have the problem that i have to manage the values of an dropdowm-field.
if conditions 1 = value 1
if conditions 2 = value 2

but if condition 1 = true and condition 2 also true the dropdown should have value 1 and value 2 to choose (the real formular is much more complex)
How can i define in the "data builder 2" that the value is added to existing values?

I hope i explained the problem clearly enough - my english is not the best
he healyhatman 23 Jan, 2020
Answer
1 Likes
Could do it in PHP. If it's a {var:} then you would do
$this->set('variable_name', $this->get('variable_name') + ['new_key' => 'new_value']);
This topic is locked and no more replies can be posted.