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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

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

DropdownField with optional TextField ?


Go to End


1311 Views

Avatar
brice

Community Member, 52 Posts

31 March 2010 at 6:35am

Is it possible to combine a Dropdown field with a plain text input field? I'm in ModelAdmin and would like to customize a DataObject's varchar field via getCMSFields() to display a dropdown of options as well as an area to add custom input if applicable.

E.g.

"Reason"

[Select]
"reason 1"
"reason 2"
"reason 3"
"other"

[Text] (input used when other selected)

I haven't found a matching fieldtype for this, but am thinking CompositeField(?)

Thanks ahead!