Add option is not already exists (DynamicDropdownQuestion?)
Closed this issue · 3 comments
hugolytics commented
Would it be possible to have a dropdown where the user can select existing values but also add an option if it doesn't exist already?
So like a dynamic dropdown question?
cguardia commented
Hi. We depend on SurveyJs functionality, and this is not yet supported there, but seems to be planned for the future. See https://surveyjs.answerdesk.io/ticket/details/t5899/is-it-possible-to-have-the-dropdown-and-text-box-in-the-same-element
hugolytics commented
In that case, would it be possible to add an "other" option to the dropdown and have that dynamically create a textbox for the user to add their category?
cguardia commented
It is possible. It would be something similar to this (untested) code:
reason = DropdownQuestion(choices=["Too many emails", "Not interested", "other"])
reason_other = TextQuestion(visible_if="{reason} == 'other'")