Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

Populate userform dropdown with values from a db table?


Go to End


3 Posts   2446 Views

Avatar
FuturShoc

Community Member, 4 Posts

17 December 2011 at 11:19am

The userform module seems to have alot of what I need in form processing. However, I would need a dropdown list in my form to contain options from a pre-existing database table.

Does anyone have an example of this they could point me to?

Avatar
Willr

Forum Moderator, 5523 Posts

17 December 2011 at 10:21pm

Check out the member list field as an example - https://github.com/silverstripe/silverstripe-userforms/blob/master/code/editor/EditableMemberListField.php. You would need to create a new form field for your use case.

Avatar
FuturShoc

Community Member, 4 Posts

19 December 2011 at 4:16am

I'll look into that. Thanks for your reply!