Search code examples
jqueryjquery-autocomplete

Only jquery autocomplete download


I want to download jquery autocomplete plugin, but it doesn't let me download only that file but with jquery core, jquery position, widget etc. scripts. But I don't want all these files as I already have them added in my project and working fine, so I don't want to break any current working logic.

When I tried putting all the script came with autocomplete(including core.js), it worked but then my datepicker stopped working.

I also tried picking and adding only autocomplete script part from the full script but it didn't work, may be because I am using jquery 1.7.2 and I found autocomplete 1.10.2.

Is there any way to get only autocomplete plugin or any similar plugin that can work something like we get other plugins from outside authors?

Basically my requirement is not exactly of autocomplete, what I want is to have a text box that on focus show the list of options to choose, something like dropdownlist options but also lets us put our own value and don't show the dropdown list arrow. I made this all working with the help of autocomplete plugin, the problem came when I tried adding it in my project.

Basically this requirement

enter image description here

Any idea what I can do?


Solution

  • You can go to the All jQuery UI Downloads page and get the file with the source.

    Then, in the ui folder, you will see separate files for each module, including jquery.ui.autocomplete.js.

    I do not know how your files are organized in your project, but be aware that the autocomplete module needs core, widget, position and menu in order to work. The first two must be loaded before autocomplete.

    Your code should look like this:

    <script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.core.js"></script>
    <script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.position.js"></script>
    <script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.menu.js"></script>
    <script type="text/javascript" src="vendor/jquery-ui/js/jquery.ui.autocomplete.js"></script>
    

    Hope it helps!