Jonathan M
Jonathan M

Reputation: 17461

Twitter-Bootstrap typeahead not working

I'm having some trouble getting the typeahead working in Bootstrap, and I've boiled the problem down to this short example. (I'm new to Bootstrap.) When I type in the input, no typeahead suggestions appear. Any ideas why this isn't working?

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    </head>
    <body>
        <div class="container">
            <label for="primaryCustName">Name:</label>
            <input type="text" data-provide="typeahead" data-source="['Bob','Jim','Sue']" class="form-control" id="primaryCustName">
        </div>
    </body>
</html>

Upvotes: 0

Views: 1650

Answers (1)

joshhunt
joshhunt

Reputation: 5345

The typeahead function was removed from Bootstrap in v3. According to @mdo it was dropped "in favor of folks using Twitter's typeahead. Twitter's typeahead has more features than the old bootstrap-typeahead.js and less bugs."

Your two options from here are:

  1. Use a port of Bootstrap v2 Typeahead, you can find one here.

  2. Use Twitter Typeahead which can be found here.

Upvotes: 1

Related Questions