SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Script.aculo.us library help

    Hi all,

    I'm developing an ajax enabled project using script.aculo.us library. I need to display autocomplete textbox with the values available in javascript array. Since there is a control in library
    Code:
    Autocompleter.Local ('txt_id','div_id',jsVariable,{options})
    , but I am frequently updating the jsVariable in other js function in the page but the autocomplete dropdown still display the values which exists in jsVarible while creating the Autocompleter.Local call. I also tried to call Autocompleter.Local...... again with the updated variable but still sometime it shows the old values.

    someone guide me in this regard.
    Thanks in advance

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    before you call Autocompleter.Local try removing the contents of the combobox.

    var cmb = document.getElementById('comboID');
    cmb.options.length = 0;

    that removes all items from the combobox and then I presume running Autocompleter.Local repopulates them.


  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thnx I need the autocomplete option for a textbox.
    but I found another way also,
    Code:
    var id = new Autocompleter.Local ('txt_id','div_id',jsVariable,{options});
    id.option.array = jsVariablUpdated;
    also works.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •