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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:03:17+00:00 2026-05-23T14:03:17+00:00

I have an autocomplete which takes results from google suggestions. On a page I

  • 0

I have an autocomplete which takes results from google suggestions. On a page I have multiple input fields which I’d like to include that function so that all inputs will be taking results from google suggestion and using the jquery autocomplete widget.

Here is a Fiddle: http://jsfiddle.net/8q25P/

Note on the first input it parse’s google queries. On the second which has different ID its where I want to implement the feature aswell.

Thanks alot

  • 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-23T14:03:17+00:00Added an answer on May 23, 2026 at 2:03 pm

    Here are the changes..

    http://jsfiddle.net/gaby/ag9gv/


    First you need to apply the autocomplete to both elements and also bind the retrieve to both.

    $('#q, #w').keyup(retrieve);
    

    and

    $('#q, #w').autocomplete({
            source: []
        });
    

    You also need to change your ajax call and the retrieve method a bit, to make the related element auto-discoverable.. (create a variable and pass it to the success method)

    function retrieve() {
        var _this = this;
        $.ajax({
            type: "GET",
            url: 'http://suggestqueries.google.com/complete/search?qu=' + encodeURIComponent($(this).val()),
            dataType: "jsonp",
            success: function(data){parse(data,_this);}
        });
    }
    
    var parse = function(data,element) {
        var results = [];
        for (var i = 0; i < data[1].length; i++) {
             results.push(data[1][i][0]);
        }
        $(element).autocomplete({
            source: results
        });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used ajaxtool kit's autocomplete on a page which gets data from a
I have a jQuery autocomplete field which gets results from Amazon's autocomplete, as you
I have some jQuery that takes the value of a text input and puts
I have an autocomplete field which I would like to augment by providing a
I have primefaces autocomplete which is fetching values from database. When I type in
I have two AutoComplete widget on which i have registered setOnItemClickListener like this productTextView
I have a layout in which I have autoComplete edit text with some suggestions.
I have a jQuery autocomplete fild which gets existing data from my MVC action.
I have an autocomplete box which I would like to be able to close
I have a plugin of auto complete which takes 3 parameters $(function(){ setAutoComplete(id, results,

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.