【发布时间】:2020-03-04 01:11:02
【问题描述】:
我想要一个自定义的select field 有 3 个选项:dog、cat、other - 另一个是什么时候选择我希望空白文本输入出现在下方,以允许用户在其中写下他最喜欢的动物。
有没有办法根据选择的选项有条件地呈现字段?
<%=
select f, :animal, [
{"Dog", :dog},
{"Cat", :cat},
{"Other", :other}
]
text_input f, :animal
%>
【问题讨论】:
标签: forms elixir phoenix-framework