0

I want to change the autocomplete options of a complete.ly object based on the selection made in another dropdown list.

I call the updateAuto function through JQuery by doing $("#ddlToWatch").change(updateAuto).

The updateAuto function definition is as follows :

function updateAuto() {

var optionsDD;
if ($("#ddlToWatch").val() == "bla") {
    optionsDD = [
     'blabla',
     'blabla2'
    ];
};

$("#mycompletelybox").options = optionsDD;

};

It seems like you can't access directly the options using JQuery for complete.ly objects. What is the recommended way to access those if that is indeed the issue ?

Any help welcome.

Chapo
  • 2,563
  • 3
  • 30
  • 60

1 Answers1

0

I ended up initializing the textbox with a global variable

var mybox;
$(function() {
    mybox = completely($("#mycompletelybox"), {color:'black'});
}

and using that variable in my code above. So, instead of

$("#mycompletelybox").options = optionsDD;

use

mybox.options = optionsDD;
Chapo
  • 2,563
  • 3
  • 30
  • 60