I’m trying to build a form where a user can select an existing category, or define their own.
My form looks something like this…
<%= f.select :category, category_options, prompt: "Select">
<%= f.text_field :category %>
However, this UI is confusing. The user can select something in the select box, and type in a custom category. In this case, the final result is not obvious.
Do you guys have any recommendations on how to handle this situation?
By default, text field will be hidden and disabled
Dropdown should have “OTHER” option
when user selects “OTHER” option,
text field will be enabled and displayed,then user should be able to enter value there.