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 8165497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:33:08+00:00 2026-06-06T19:33:08+00:00

There are many threads and samples out there about typeahead ( https://gist.github.com/1866739 ) and

  • 0

There are many threads and samples out there about typeahead (https://gist.github.com/1866739) and also a forked version, but I simply cannot find anything on allowing the user to “add” what he/she has written, if it’s not already in the list. If the user continues typing when there are 0 results, the results ul is hidden…

typeahead
enter image description here

I’d like to add an <li> that is the value of input (that I know how to do), but the dropdown disappears if the user continues typing input and there are 0 matches.

When I come down to 1 match “count li” for amount: “1” works, but to count 0 doesn’t work, it’s as if the entire list is “repopulated” again if there are no matches.

Links, hints, or examples would be much appreciated!

  • 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-06T19:33:09+00:00Added an answer on June 6, 2026 at 7:33 pm

    I really don’t get what is the issue, but I’m assuming that’s because it is to easy and you just don’t see it.

    Instead of having a button to make the user to add it’s own interest (instead of selecting it from the list – your source), you could simply accept the user value using $('.typeahead').val();

    here is a live demo, fell free to add your own items and press Enter in order to effectively have them as the typehead source.

    in your page, you could actually use $.ajax() to add the new item to your database at once, or wait until the user submit the form and add it.

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

Sidebar

Related Questions

There are many threads about going the opposite way, but I am interested in
While there are many samples around about using OpenGL ES on Android all of
I know there are many threads about calculating from lat/long to metric systems. This
I know there are many threads that talk about this problem but I don't
There are many threads in the forum about the Friends and Templates. I specially
Is there any way to check how many threads are waiting for a synchronized
I have a black box of code that contains many threads. There is no
There are many solutions geared toward implementing user-space threads. Be it golang.org goroutines, python's
There were many questions about C++ template classes which contain static member variables, as
There are many threads on find replace text for python but I think my

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.