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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:29:54+00:00 2026-05-14T18:29:54+00:00

I’m using Jorn Zaefferer’s Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ I have options set so it

  • 0

I’m using Jorn Zaefferer’s Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

I have options set so it shows all the values when you click in the empty text field, a bit like a select, and the option is also set so that the user can only choose from the list of values used by the autocomplete (so it’s kind of like a select but with autocomplete functionality).

I have two radio buttons below the text field, which determine whether the user chooses from a long list or a short list of possible values. I want to update the values used in the autocomplete when one of these radio buttons is clicked. Currently i’m doing this in a not very clever way by calling autocomplete again on the same text field, with the different array of values, but this creates a situation where both are active at once, and i can see the long list peeking out from behind the short list.

What i need to do is either
a) dynamically change the values used in the autocomplete or
b) remove (unbind?) the autocomplete from the text field before re-initialising it.

Either of these would do tbh though option a) is kind of nicer.

Any ideas anyone? Here’s my current code:

function initSubjectLongShortList(field, short_values, long_values){
  $(".subject_short_long_list").change(function(){
    updateSubjectAutocomplete(field, short_values, long_values);
  });
  updateSubjectAutocomplete(field, short_values, long_values);
}

function updateSubjectAutocomplete(field, short_values, long_values){
  if($(".subject_short_long_list:checked").attr('id') == "subject_long_list"){
    initSubjectAutocomplete(field, long_values);
  } else {
    initSubjectAutocomplete(field, short_values);    
  }
}

function initSubjectAutocomplete(field, values){
  jQuery(field).autocomplete(values, {
    minChars: 0,  //make it appear as soon as we click in the field
    max: 2000,
    scrollHeight: 400,
    matchContains: true,
    selectFirst: false
  });     
}

cheers, max

  • 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-14T18:29:55+00:00Added an answer on May 14, 2026 at 6:29 pm

    It’s done like this, as far as I remember.

    a)

    $("#id").setOptions({
      data: array_goes_here
    }).flushCache();
    

    b)

    $("#id").unbind();
    

    You can choose either way.

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

Sidebar

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.