I'm very new to Silverstripe,
On the CMS page I can add a dropdown form item, and I see that I can create options. BUT. What I want to do is populate the dropdown from an array. How can I do this?
The array will look something like this:
$dropdownFields = array(
'option1' => array(lots of emails),
'option2' => array(lots of emails),
'option3' => array(lots of emails),
etc
)
I think what I want to do is have a DataObject with an 'option' field and a 'text' field where emails are entered in CSV format.
But how can I get the dropdown menu UserForms to retrieve option values from the DataObject instead of as an input from a user via the cms...
You cannot achieve this via the CMS and the module alone. You will need to create a custom EditableFormField to achieve this.
Subclass this and make changes where necessary: https://github.com/silverstripe/silverstripe-userforms/blob/master/code/model/formfields/EditableDropdown.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With