2017-05-17 6 views
0

私はJQuery UIと.net MVCを使ってオートコンプリートテキストボックスを開発しています。ただし、提案されたオプションを選択すると、その候補のランダムdivがページに追加され、テキストボックスも完成します。JQueryUIオートコンプリート - ランダムディビジョンが追加されました

HERESに私のコード:

@ModelType Test 
@Code 
    Layout = "~/Views/Shared/_Layout.vbhtml" 
    ViewBag.Title = "asdasd" 
End Code 

<script type="text/javascript"> 

    $(document).ready(function() { 
     $("#Search").autocomplete({ 
      source: function (request, response) { 
       $.ajax({ 
        url: "/Test/Search", 
        type: "POST", 
        dataType: "json", 
        data: { Prefix: request.term }, 
        success: function (data) { 
         response($.map(data, function (item) { 
          return { label: item.Name, value: item.Name }; 
         })) 

        } 
       }) 
      }, 
      messages: { 
       noResults: "", results: function (resultsCount) { } 
      } 
     }); 
    }) 
</script> 

<div class=""> 
    @Using Html.BeginForm("AuthenticateStage1", "Authentication") 
    @Html.AntiForgeryToken() 
    @<div class="form-group"> 

      @Html.EditorFor(Function(x) x.Search) 

    </div> 
    End Using 
</div> 

ここでは、ブラウザで次のようになります。http://prntscr.com/f8u7d1私は候補の1つを置くとされます。

したがって、明確にするために、左隅のdivが作成されるのはなぜですか?どのように私はそれを停止することができます。

おかげ

答えて

0

は、私がJQueryUIの壊れたバージョンを使用していたが判明します。

関連する問題