I have a auto complete box set up. however when a user types in the box a list of every single item appears. Not relating to anything the user is typing in.
What am i doing wrong?
Jquery:
var availableTags = '@Url.Action("PopSearch", "Home")';
$("#searchtxt").autocomplete({
source: availableTags
});
Controller function:
public ActionResult PopSearch()
{
IndustryManager manager = new IndustryManager();
ProductRangeManager manager2 = new ProductRangeManager();
ProductCategoryManager manager3 = new ProductCategoryManager();
IList industryList = manager.GetIndustries();
IList rangeList = manager2.GetAllProductRanges();
IList categoryList = manager3.GetAllProductCategories();
var attributes = industryList.Select(x => x.Name)
.Union(rangeList.Select(x => x.Name))
.Union(categoryList.Select(x => x.Name)).ToArray();
return Json(attributes, JsonRequestBehavior.AllowGet);
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)