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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:28:11+00:00 2026-05-26T15:28:11+00:00

I am using JQuery UI autocomplete on my website. I am creating the auto

  • 0

I am using JQuery UI autocomplete on my website. I am creating the auto complete object like so:

  $.widget( "custom.code_complete", $.ui.autocomplete, {
    _renderMenu: function( ul, items ) {
            var self = this,
                currentCategory = "";
        $ul = ul;
            $.each( items, function( index, item ) {
                if ( item.category != currentCategory ) {
                    ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
                    currentCategory = item.category;
                }
                self._renderItem( ul, item );
            });
        }
    });

  $("#r-code").code_complete({
    source: "URL",
    minLength: 2,
    select: function(event, ui) {
      $(".button-row").fadeIn();
      get_details(ui.item.url);
    }
  });

This setups the autocomplete field fine. I can search inside the field fine and it brings back results without a problem. Sometimes however the users will be redirected from another page with the autocomplete value set as a parameter and if this is the case the autocomplete will be triggered programmatically, I am trying to do this with the following code:

function parse_param_code(code) {
  console.log(code);
  $("#r-code").autocomplete('search', code);
}

This method is called successfully and the code is put out to the console but the autocomplete search is not triggered and does not do anything. Am I doing something wrong in my code for this not to trigger a search? I have read the JQuery UI documentation and the above code is supposed to trigger the search method. Any help would be appreciated.

Thanks

Eef

  • 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-26T15:28:12+00:00Added an answer on May 26, 2026 at 3:28 pm

    Changing the
    $("#r-code").autocomplete('search', code);

    to your own widget name, i.e:

    $("#r-code").code_complete('search', code);

    produces the desired result.

    example: http://jsfiddle.net/vHJsu/

    If you do a console.log($("#r-code").data("autocomplete")); you’ll notice there isn’t a widget with that name attached to the element.

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

Sidebar

Related Questions

I'm using jQuery autocomplete which makes a UL with items like: <li class=ui-menu-item role=menuitem>
I'm using jQuery AutoComplete, and I have an auto-complete search box to search for
I'm using jQuery autocomplete plugin from jQuery website calling the controller url which return
I have being using jquery autocomplete. By default it is showing 10 items in
I am using jquery autocomplete and trying to define the values for the auto
I am using jQuery autocomplete pluggin . I have the following code $().ready(function() {
I am using jQuery UI Autocomplete with ASP.NET like this : First I am
I am using the jquery autocomplete combobox . I would like it to autosize
using jquery I have a autocomplete text box like the combobox example on the
Am using JQuery Autocomplete on my templete, but as i get the results the

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.