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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:12:34+00:00 2026-06-15T23:12:34+00:00

I have an autocomplete snippet which retrieve’s City names based on your search term.

  • 0

I have an autocomplete snippet which retrieve’s City names based on your search term.

For example the search term s would print:

enter image description here

So if I would use:

var f = [];
$.each(a.RESULTS, function (a, b) {
    f.push(b.name /* + b.zmw */)
});
b(f)

I would get printed the name of every city.

Live Example: http://jsfiddle.net/muWah/18/

How could I print/console.log() the zmw value of each city whenever I click on it.

So when I click on Serbia, I should get printed 000RB.1.99999

  • 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-15T23:12:35+00:00Added an answer on June 15, 2026 at 11:12 pm
    $.each(a.RESULTS, function (a, b) {
       f.push({label: b.name, value : b.zmw})
    });
    

    You can push a new object, with a label and value.
    Label is what’s picked up for auto-complete, and value is what appears in the input when selected.

    DEMO: http://jsfiddle.net/muWah/21/

    If you wanted to just have the zmw reference in the console, rather than printed out in the input, you can add more properties to the object you passed through. For example:

    $.each(a.RESULTS, function (a, b) {
        f.push({label: b.name, value : b.name, zmw : b.zmw})
    });
    

    Then b.item.zmw would be what you’d print out in your console, but the name/value would still be "Serbia" (or whatever you click on)

    DEMO: http://jsfiddle.net/muWah/24/

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

Sidebar

Related Questions

I have an autocomplete field which I would like to augment by providing a
I have an autocomplete box which I would like to be able to close
I have autocomplete text box, that is JQuery based. when i record the macro,
I have a autocomplete textbox, in that textbox am getting employee names. If I
I have an autocomplete which does a query to DB....when doing a click on
I need to have an autocomplete functionality using jquery, and I've encountered ZendX_JQuery which
I have my autocomplete component connecting to my managed bean which then connects to
I have a layout in which I have autoComplete edit text with some suggestions.
would love your thoughts on this one. I am using jQuery autocomplete in a
I have a jQuery autocomplete set up, for which I have a few special

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.