Here is how to setup the Dynamic Options behavior for the dropdown fields and multi selection fields in ChronoForms v8, the same setup can be used for Chronoforms v7
Start by preparing your options array, your can do this using:
- PHP action if your have a static or complex source of data
- Read Data action action if your options are coming from the database directly
We will use a PHP action here:
The PHP actions will return an array with options values and texts
Next, enable the Dynamic Options behavior in your dropdown and set the Data Source as {var:php25}, which in this case is the returned value from PHP action named "php25", the action we have just created
We will also need to set the Option value path to: {row:value} and the Option value text to {row:text} as this is the path for the values and texts in our array:
You may add any default options to the Options box, those will appear before the dynamic options