Html 如何禁用下拉列表中的默认选项
我想禁用下拉列表中给出的默认选项。 e、 g.下拉列表中有三个值Html 如何禁用下拉列表中的默认选项,html,ruby-on-rails-3,Html,Ruby On Rails 3,我想禁用下拉列表中给出的默认选项。 e、 g.下拉列表中有三个值 ["Select a status", "Processing", "Completed"] 我想在“选择状态”中应用禁用和选定的属性 你能告诉我怎么做吗?我无法在同一个值上同时使用这两个属性。您是否尝试过使用options\u for\u select <%= select_tag(:city_id, options_for_select(["Free", "Basic", "Advanced", "Super Plat
["Select a status", "Processing", "Completed"]
我想在“选择状态”中应用禁用和选定的属性
你能告诉我怎么做吗?我无法在同一个值上同时使用这两个属性。您是否尝试过使用
options\u for\u select
<%= select_tag(:city_id, options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => "Super Platinum", :selected => "Super Platinum")) %>
“超级白金”,选中=>“超级白金”))%>
以下内容对我很有用
<%= select("post", "person_id", options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => "Super Platinum", :selected => "Super Platinum" )) %>
“超级白金”,选中=>“超级白金”))%>
是的,我尝试过这个,但它没有使“超级白金”成为默认选项。