I'm currently working on a web application. There, I created a Textbox (Works with jquery autocomplete) which shows up when the user clicks on a button. Then I want to load the needed source for autocomplete from my database. But I'm currently testing it with some random values. When I call this:
$("#docNameTB").autocomplete({
source: ["Apple", "Banana"]
});
The console says: "Uncaught TypeError: $(...).autocomplete is not a function"
Here are my script sources:
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
Here's my event code:
function nextClicked() {
$("#docNameTB").autocomplete({
source: ["Apple", "Banana"]
});
}
And here's my Textbox:
@Html.TextBox("docNameTB", "", new { @class = "form-control", @placeholder="Enter name here" })
Here's my button Press code:
<a class="btn btn-default" id="nextButton" onclick="nextClicked()">Next »</a>
The solution of this question didn't work for me. I only use the google places script source too and this is not a problem (I have tested it already):
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places"></script>
Sry for my bad English and my formatting this is my first question. :) I hope somebody can help me! Thanks for your reply!