Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9193137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:05:24+00:00 2026-06-17T21:05:24+00:00

I am using twitter bootstrap typehead. $(document).ready(function() { $(#searchfield).typeahead({ minLength: 3, source: [type1, type2,

  • 0

I am using twitter bootstrap typehead.

 $(document).ready(function() {
        $("#searchfield").typeahead({
            minLength: 3,
            source: ["type1", "type2", "dtype3", "dtype4"]
        });
    });

I want to display all the soucre in the drop down(suggestion drop down), when I focused on input tag (“#searchfield”) even it is empty. That means I want all source to display when I didn’t enter any letter. If I entered any letter it needs to show the relevent data (normal functionality of typehead.)

OR

On clicking on some link. dropdown need to provide all given source.
Example:

<a href="#someId">Click here to populate typehead in #searchfield input tag </a>
<input type="text" id="searchfield">

On cliking the link, the input field needs to populate the dropdown with all given sources(type1, type2, dtype3,dtype4)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:05:26+00:00Added an answer on June 17, 2026 at 9:05 pm

    I changed the following method in the plugin like this

    , lookup: function (event) {
          var that = this
            , items
            , q
    
          this.query = this.$element.val()
    
        //console.log(this.query);
        //alert("this.query"+ this.query);
    
          if (!this.query) {
             return this.shown ? this.hide() : this
          }
    
          items = $.grep(this.source, function (item) {
           if this.query == "*"
              return item
           else
              return that.matcher(item)
    
          })
    
            //console.log("==items=="+items.length);
            //console.log(items);
    
          items = this.sorter(items)
    
           if (!items.length) {
            return this.shown ? this.hide() : this
          }
    
          return this.render(items.slice(0, this.options.items)).show()
        }
    

    And binded the click event to anchor tag(<a id="someID" ......)

    jQuery('#someID').click(function(){
         var $input = $("#seachfield");
         //add something to ensure the menu will be shown
          $input.val('*');
          $input.typeahead('lookup');
          $input.val('');
    
    
    });
    

    Hope this may help to others..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using twitter bootstrap typeahead i get google chrome suggestion list above typeahead list $(document).ready(function
I'm using Twitter Bootstrap with Jquery. I want to use the TYPEAHEAD function for
I'm using the Twitter bootstrap-typeahead plugin with an HTML form: http://twitter.github.com/bootstrap/javascript.html#typeahead which is working
I'm using the rottentomatoes movie API in conjunction with twitter's typeahead plugin using bootstrap
I am using the typeahead js extension from twitter bootstrap for an autocomplete field.
I am using the Typeahead component of Twitter Bootstrap 2.1.1, and jQuery 1.8.1 I
Hi i am using twitter bootstrap. I have used typeahead in my model window.
When using the typeahead functionality from Twitter Bootstrap ( example ) the first suggestion
I'm using twitter bootstrap and my nav bar works fine with collapse function. This
I'm using this fork of the Twitter Bootstrap typeahead library , which allows asynchronous

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.