Bootstrap Autocomplete
jQuery plugin adding autocomplete to Bootstrap text inputs and select fields with AJAX support
What it is
Bootstrap Autocomplete is a lightweight jQuery plugin that enhances standard HTML input and select elements with autocomplete functionality using Bootstrap's native dropdown component. The library works with both Bootstrap 3 and 4 without requiring custom styles, making it a drop-in solution for developers building forms that need type-ahead search or select enhancement.
The plugin supports remote data fetching through AJAX requests with configurable throttling, minimum character length, and query parameters. It handles both simple text autocomplete returning string arrays and select autocomplete returning objects with value and text properties. Developers can customize every step of the suggestion workflow through callbacks for formatting results, manipulating server responses, and implementing custom resolvers.
Installation is straightforward via CDN, NPM, or Yarn, and activation requires only a few lines of JavaScript or data attributes in the markup. The plugin exposes events for selection, free value entry, dropdown visibility, and value changes, allowing integration with form validation and other UI logic. Internationalization is supported through data attributes for error and no-results messages.
This tool targets front-end developers and teams building administrative interfaces, search forms, or any UI requiring assisted input. Its dependency on jQuery and Bootstrap makes it suitable for legacy and existing Bootstrap-based projects rather than modern framework applications. The comprehensive documentation covers basic usage, select enhancement, event handling, and all configuration options.
This description was generated by AI from the site's public content and may contain errors.
What you can do there
- Read comprehensive documentation for the autocomplete plugin
- View installation instructions for CDN, NPM, and Yarn
- See code examples for text and select autocomplete
- Review all configuration options and events
- Access the project via GitHub repository links
Who it's for
Front-end developers using Bootstrap and jQuery who need autocomplete functionality in forms
Frequently asked questions about bootstrap-autocomplete.readthedocs.io
›Does Bootstrap Autocomplete work with Bootstrap 5?
The documentation specifies support for Bootstrap v3 and v4 only with automatic version detection. Bootstrap 5 compatibility is not mentioned.
›Can I use this plugin without jQuery?
No, Bootstrap Autocomplete is built as a jQuery plugin and requires jQuery to function.
›How do I customize the appearance of dropdown results?
Use the formatResult callback to return custom HTML or modify the text and ID properties for each rendered item.
›Is there a way to prevent form submission when pressing Enter?
Yes, set the preventEnter option to true to stop the default Enter key behavior which often submits forms.
›What response format does the plugin expect from the server?
For text inputs it expects a simple JSON array of strings. For select elements it expects an array of objects with value and text properties.
›Can I implement my own search logic instead of AJAX?
Yes, set the resolver option to custom and use the search event callback to implement custom lookup logic.
