2
<script>
$(function() {
var availableTags = [
"NSDL",
"CDSL",
"ROCA",
"NSE",
"SEBI"
];
$("#search").autocomplete({
source: availableTags
});
});
</script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
在_index.js.erb
:
<%= form_tag service_requests_path, method: :get,:id=>"search_form" do %>
<%= text_field_tag :search , nil, class: 'form-control input-breathe', required: true, placeholder: 'Searching for...', :autocomplete=> :on%><%end%>
我想只用文本框进行搜索,而无需使用任何button.Now我从让所有的值文本框。但问题是,当我选择任何标签时,它应该搜索包含此标签的所有服务请求。我怎样才能做到这一点?
它,不工作。我已经编辑了我的代码上面。 –
您是否将ID添加到搜索表单中? –
感谢它的工作。 –