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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:30:43+00:00 2026-05-24T20:30:43+00:00

hi i am using Ajax AutoComplete for jQuery in my jquery i am using

  • 0

hi i am using Ajax AutoComplete for jQuery

in my jquery i am using

        options = { serviceUrl: "<? echo $this->config->item('base_url'); ?>index.php/welcome/autocomplete" };    
        a = $('#query').autocomplete(options);

i saw that i can pass extra parameters like

var a = $('#query').autocomplete({ 
    serviceUrl:'service/autocomplete.ashx',
    minChars:2, 
    delimiter: /(,|;)\s*/, // regex or character
    maxHeight:400,
    width:300,
    zIndex: 9999,
    deferRequestBy: 0, //miliseconds
    params: { country:'Yes' }, //aditional parameters
    noCache: false, //default is false, set to true to disable caching
    // callback function:
    onSelect: function(value, data){ alert('You selected: ' + value + ', ' + data); },
    // local autosugest options:
    lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values 
  });

so i want to create n new parameter and pass it like this

         var a = $('#query2').autocomplete({ 
             serviceUrl: "<? echo $this->config->item('base_url'); ?>index.php/welcome/autocomplete",
             id:'query2'
            });

How can i access that extra parameter from the autocomplete code ?? i want to add that id to my

.autocomplete-w1

initially it looks like this

<div class="autocomplete-w1"></div>

i want to change it to

 <div id="jquery2" class="autocomplete-w1"></div>

please help…………………………..

UPDATE

i tried to adding my id parameter to this function

  function Autocomplete(el, options) {
    this.el = $(el);
    this.el.attr('autocomplete', 'off');
    this.suggestions = [];
    this.data = [];
    this.badQueries = [];
    this.selectedIndex = -1;
    this.currentValue = this.el.val();
    this.intervalId = 0;
    this.cachedResponse = [];
    this.onChangeInterval = null;
    this.ignoreValueChange = false;
    this.serviceUrl = options.serviceUrl;
    this.isLocal = false;
    this.options = {
      autoSubmit: false,
      minChars: 1,
      maxHeight: 300,
      deferRequestBy: 0,
      width: 0,
      highlight: true,
      params: {},
      fnFormatResult: fnFormatResult,
      delimiter: null,
      zIndex: 9999,
      id:'test'
    };
    this.initialize();
    this.setOptions(options);
  }

i gave a default value test . when i alert $this.options.id i always getting 'test' the value i passig jquery2 is not getting . what is the problem there ????

  • 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-24T20:30:44+00:00Added an answer on May 24, 2026 at 8:30 pm

    hmmm. i have solved it .

    i added extra parameter id

            a = $('#query').autocomplete({
                                            serviceUrl: "<? echo $this->config->item('base_url'); ?>index.php/welcome/autocomplete",
                                            id: 'query'
                                        });
    

    in my jquery.autocomplete.js in

     function Autocomplete(el, options) {
    

    i get that parameter like

      this.id = options.id;
    

    now i can add it to div’s id

    <div class="autocomplete-w1" id='+this.id+'></div>
    

    thanks……………….. 🙂 🙂 😀

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

Sidebar

Related Questions

I'm using the AutoComplete control from the ASP.NET AJAX Control Toolkit and I'm experiencing
How do I preview a url using ajax? I have seen this done with
Can you do ajax on ASP.net webform without using ajax toolkit? (Please post a
I am creating a chat using Ajax requests and I'm trying to get messages
I'm using $.post() to call a servlet using Ajax and then using the resulting
I need to upload images using FileUpload without postback(using Ajax).I tried many examples.But in
Does anybody know of an up to date tutorial on using Ajax with ASP.net
Im trying to find a best practice to load usercontrols using Ajax. My first
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
I have some forms that communicate with server using AJAX for real reasons: cascade

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.