Question

im making a call to load function which dynamically loads a part of the jsp. after the load functionm call i notice that the autocomplete on a input box is not being responsive. it was fine earlier before the load function call. The load function replaced a a div with the given id and the autocomplete textbox already exists before the load call. the following is the code for my autocomplete. please help

$('.directoryAutoComplete').autocomplete({
    source : system.ctx+ '/autocomplete/people',
    focus : function() {
        return false;
    },
    select : persons.autocompleteSelected,
});
Was it helpful?

Solution

You have to reattach the autocomplete after you dynamically load the new html. When you swap out the html you've removed the autocomplete as well as the old html.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top