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

  • Home
  • SEARCH
  • 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 8687849
In Process

The Archive Base Latest Questions

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

I have Posts tied to a location so when I make jQuery autocomplete on

  • 0

I have Posts tied to a location so when I make jQuery autocomplete on that location field results with same name appear in the dropdown.

For example:

If there are 10 posts with location Berlin and I start typing the city name the autocomplete will give me the name of the location multiplied by the number of posts. I was wondering if there is a way to group location names using jQuery.

Thanks

  • 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-12T23:12:42+00:00Added an answer on June 12, 2026 at 11:12 pm

    This jquery ui demo is similar to your requirement.

    The original data:

    var data = [
                    { label: "anders", category: "" },
                    { label: "andreas", category: "" },
                    { label: "antal", category: "" },
                    { label: "annhhx10", category: "Products" },
                    { label: "annk K12", category: "Products" },
                    { label: "annttop C13", category: "Products" },
                    { label: "anders andersson", category: "People" },
                    { label: "andreas andersson", category: "People" },
                    { label: "andreas johnson", category: "People" }
                ];
    

    you can change them to

     var data = [
                    { label: "Berlin", category: [post1, post2] },
                    { label: "Paris", category: [post3, post4, post5] },
                    { label: "Tokyo", category: [post6, post7, post8] },
                    { label: "Taipei", category: [] }
                    ...
          ];
    

    To retrieve the value

    select: function( event, ui ) {
                    console.log( ui.item.label );
                    console.log( ui.item.category ); //this is an array
                    return false;
    }
    

    And http://jqueryui.com/autocomplete/#custom-data
    is a demo about custom data format of dropmenu

    I hope this sample helpful.

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

Sidebar

Related Questions

I have seen posts all over the internet that talk about how to fix
So for example ... Lets say I have a Posts model and a News
I have created a category template in Wordpress for all posts that are in
Is it possible to make a wordpress page have posts and static content on
I have a form that has many checkboxes (too many for it to make
Friends I have a problem We need to make a user control that has
I have posts that are echoed out of my mysql database. If there is
I have a homepage with four displayed posts and one that is emphasized. The
I have a jQuery dialog that needs to be opened and populated with data
I have POSTS that can have many TAGS . I only want my query

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.