基于semantic既可以下拉框也可以文本框输入

阅读更多

<%= select_tag "quantity", options_for_select( %w(100g 250g 500g 500ml 1kg 1L 2.5L 5kg 5L 10kg 10L).unshift(@chemical_info[:quantity]).uniq, @chemical_info[:quantity]), include_blank: "选择数量", class: 'ui search fluid dropdown J_quantity' %>
$('.J_quantity').dropdown({ allowAdditions: true, onChange: function(val) { var tag_id = $("#tag_id").val(); var quantity = val; window.location.href = '/admin/print/whmall_tags/print?tag_id='+tag_id+"&inventory_id="+"<%= @chemical_info[:from_id] %>"+"&quantity="+quantity ; } }); allowAdditions: true的作用类似: 下拉框可选,可填写 $('.J_quantity').find('input').removeAttr('readonly');

你可能感兴趣的:(semantic)