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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:59:32+00:00 2026-05-28T06:59:32+00:00

Given a straightforward jQuery Autocomplete, I’m trying to figure out how to dynamically add

  • 0

Given a straightforward jQuery Autocomplete, I’m trying to figure out how to dynamically add whatever the user has typed into the textbox as the first item that gets returned in the list.

$(document).ready(function() {
    $("input#autocomplete").autocomplete({
        source: ["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu"]
    });
});

For instance, if the user types “Alph”, the autocomplete will return:

  • Alph
  • Alpha

With the “Alpha” coming from the autocomplete source and the “Alph” being dynamically inserted.

I appreciate any help as I am very new to jQuery and currently surfing the learning curve.

  • 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-05-28T06:59:32+00:00Added an answer on May 28, 2026 at 6:59 am
    $(document).ready(function() {
        $("input#autocomplete").autocomplete({
            source: function(request, response){
                var options = ["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu"];
                var results = [request.term];
                var regex = new RegExp(request.term, "i");
                for(var i = 0; i< options.length; i++){
                    if (options[i].match(regex))
                        results.push(options[i]);
                }
                response(results);
            }       
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to extract a given frame from an animated-gif,
Given a select with multiple option's in jQuery. $select = $(<select></select>); $select.append(<option>Jason</option>) //Key =
Given an example like this: class MyForm(forms.Form): name = forms.CharField() I'm trying to grasp
Generating a truly random string of a given length is a fairly straightforward (and
A hopefully straightforward question: When ContentResolver.notifyChange() is called for a given URI, are ContentObserver
The problem is to write an algorithm to split a given linkedlist efficiently into
I've been trying to implement snook.ca's Simplest jQuery Slideshow, but when applied to child
I've been trying to find some straightforward information on this, but I haven't been
I wrote what I thought was a straightforward Python script to traverse a given
Given a specific DateTime value, how do I display relative time, like: 2 hours

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.