Reputation: 109
I have this strange problem where the results of the autocomplete function in jquery, are showing in the top-left part of the page and not under the textbox.
Here is the function.
$(function() {
$( ".txtauto" ).autocomplete({
source: 'php/getSuggerimenti.php'
});
});
And this is the textbox.
<input type='text' class='txtauto' name='primo1' />
The jquery version i'm using is the 3.3.1.
Upvotes: 0
Views: 627
Reputation: 109
I managed to resolve this problem. First i've included these links:
<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>
instead of version 1.11.4 of jquery i used 1.12.4 and the 1.12.1 of jquery-ui.
Then i changed the javascript function like this:
$( ".txtauto" ).autocomplete({
source: 'php/getSuggerimenti.php'
});
Deleting the $(function part.
Upvotes: 1
Reputation: 83
Check whether you had linked jquery.ui.css and jquery.ui.js or not this is basics you required to place result properly. if everything linked then check for css override whether any of jquery.ui class getting overloaded by your css or not.
Upvotes: 0