title: how to create Jquery autocomplete textbox with multiple words separated by comma or semicolon in asp.net MVC4
body: <p>i want to create Jquery autocomplete textbox with multiple words separated by comma or semicolon in asp.net MVC4 using jquery ajax.. i have check here <a href="http://www.aspdotnet-suresh.com/2012/07/jquery-autocomplete-textbox-with.html" rel="nofollow">a link</a> but this donot provide my answer.plz check my code this is home controller function </p>
  
  <p>//load tasks on autocomplete</p>
  
  <pre><code>    public JsonResult AutoCompleteTasks(string term)
      {
          var result = (from t in context.Tasks
                        where t.Name.Contains(term)
                        select new { t.Name }).Distinct();
          return Json(result, JsonRequestBehavior.AllowGet);
  
      } 
  </code></pre>
  
  <p>and my ajax function is </p>
  
  <pre><code>function multipleSearch(){
            $("#textarea").autocomplete({
                source: function (request, response) {
                    debugger;
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        url: "/Home/AutoCompleteTasks",
                        data: "{'term':'" + extractLast(request.term) + "'}",
                        dataType: "json",
                        success: function(data) {
                            response(data.d);
                        },
                        error: function(result) {
                            alert("Error");
                        }
                    })
                },
            });
  
         }
  </code></pre>
  
  <p>here error in
   data: "{'term':'" + extractLast(request.term) + "'}", line...plz guide me</p>