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添加到搜索表單中? –
感謝它的工作。 –