Jump to:

2002 Posts in 1422 Topics by 616 members

Form Questions

SilverStripe Forums » Form Questions » Dropdownfield, text alternative and 'required'

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 402 Views
  • stellalie
    Avatar
    Community Member
    10 Posts

    Dropdownfield, text alternative and 'required' Link to this post

    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.

  • stellalie
    Avatar
    Community Member
    10 Posts

    Re: Dropdownfield, text alternative and 'required' Link to this post

    Oh well, I end up using front end jQuery validation instead. :S

    402 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.