1971 Posts in 1275 Topics by 607 members
|Go to End|
6 October 2011 at 11:49am
I been struggling. Basically I would like design a form where the dropdown field is auto generated from existing database:
$f->push(new DropdownField('Extras',_t('CalendarDateTime.EXTRA','Extra', $this->getExtraOptions())));
Where getExtraOptions() returns for dropdown values. I would like this to be a required field, thus user will need to choose something from the dropdown menu. However, if user can't find best match in the dropdown, he/she will need to input the value in a textfield.
I was thinking to create a radiobox, if a value is selected then user need to choose a value from a dropdown, if other value is selected then user will need to put something on a text field.
How do I do this in Silverstripe?
Many thanks in advance.
7 October 2011 at 5:59pm
Oh well, I end up using front end jQuery validation instead. :S
|Go to Top|