I'm encountering an issue with my jQuery autocomplete feature.
Here is what it looks like: Autocomplete error
This is the code I am using:
<div>
@using (Ajax.BeginForm("Vyhledej", new AjaxOptions() { UpdateTargetId = "dynamicContent", InsertionMode = InsertionMode.Replace }))
{
<div class="form-group" role="group" aria-label="Basic example">
<input type="text" style="width:350px; margin-right:4px; " class="form-control pull-left" placeholder="Zadej značku" id="searchBox" name="shoda">
<button type="submit" class="btn-sm btn-default pull-left">Vyhledat</button>
</div>
</div>
And here is the JavaScript used:
> <script type="text/javascript">
> $(function () {
> $("#searchBox").autocomplete({
> source: function(request, response) {
> $.ajax({
> url: "@Url.Action("VyhledejKolobezky", "Kolobezky")",
> dataType: "json",
> data: {
> query: request.term
> },
> success: function(data) {
> response(data);
> }
> });
> },
> minLength: 2
> });
> }); </script>
Any suggestions or ideas on how to solve this? Thanks in advance.