How can I create a select list with an option for free text when option is not in list?
How can I create a select list with an option for free text when option is not in list?
Koen Verhoeven
Posts: 25Questions: 7Answers: 0
in Editor
I've got a select list with about 20 options. This list contains the most common values, but it also should be possible to enter a new value which is not in the list. How should I do this?
For example, my list is
{
"label": "Soort:",
"name": "soort",
"type": "select",
"options": [
"Option1",
"Option2"
]
},
And users should be able to type a free Option3.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The Select2 plugin allows for entering new "tags". You woulds need to enable 'tags'.
Kevin
Thanks, that was the easiest solution I could think of!
So for others looking for the same thing: I added the select2 plugin, select2 library and css as described in the link provided by Kevin.
After that I added the 'tag' option to the select2 type. See example below: