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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:58:38+00:00 2026-06-09T19:58:38+00:00

My autocomplete data comes in as such {label:Apple iPhone 3G,values:293}.. ect.. when a user

  • 0

My autocomplete data comes in as such {“label”:”Apple iPhone 3G”,”values”:”293″}.. ect..
when a user clicks an autocomplete option i want to redirect them to the product page which is based on unique id values.
Ex. when iphone 3g is picked i want it to go to example.com/293
but currently it takes in the value of whatever is typed instead of what is selected.
So say i type in A and click iphone 4g, it will not store the correct value of the iphone 4g,
but instead will store the value of the first item thats begins with a. Or if i type in iphone and select iphone 4, it will save the value of the first iphone in the database

http://mogulcases.com/matt/search.php

How im storing the key values

$.widget( "custom.catcomplete", $.ui.autocomplete, {
  _renderMenu: function( ul, items ) {
    var self = this,
               currentCategory = "";

    $.each( items, function( index, item ) { 
      self._renderItem( ul, item );

      $("input[type=hidden][name=key]").val(item.values); 

    });

  }
});

How im grabbing the values

var searchcode = document.getElementById('key').value;
  • 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-09T19:58:39+00:00Added an answer on June 9, 2026 at 7:58 pm

    Why not just do something with the select event. i.e.

    $( ".selector" ).autocomplete({
       select: function(event, ui) { 
        window.location = "http://example.com/" + ui.item.id //would send them to the page you want them to go if they click on this
      }
    });
    

    This way if a user selects something from the list you can just call the event from there and know that the item exists. And if they do not select it form the list it will perform the search when they click the search button or press enter.

    You can even change the value on select the same way

    $( ".selector" ).autocomplete({
       select: function(event, ui) { 
        $(".selector").val(ui.item.value); //I think Autocomplete does something like this automatically so may not be needed.
        //But you could do something like this
        $("input[type=hidden][name=key1]").val(ui.item.value); 
      }
    });
    

    Documentation can be found here

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

Sidebar

Related Questions

I'm having trouble in parsing my JSON data in jQuery autocomplete. My JSON comes
I have a search field that I want to autocomplete with data that I
I'm using autocomplete so user can easly enter data on inputs, like this: <?
I am working on getting an autocomplete from a remote data source. It is
I'm toying with the new autocomplete in jQuery 1.8-UI. I've provided data in the
I have an autocomplete field where user can enter lastname firstname middlename in the
Using jQuery UI's XML data parsed once autocomplete. I've checked the feed and it
I'm using Jquery autocomplete. If a user types 2 characters then waits, then types
I need my textbox to autocomplete when the user types. The value should come
i make a jquery autocomplete and its data come from mysql database.now i m

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.