0

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,
});

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

can you tell me how to do that ?
whatever routine is responsible for swapping out the html you want to call that above snipped afterwards. Just put the whole thing in after you do the swap.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.