I am using jQuery autocomplete which is working fine with existing element but not with dynamically added element.
Here is my autocomplete code (Which I have chang
You can use 'live', although these days you should be using the 'on' method.
See this thread for working examples (including one that uses 'on' if you drill down in to some of the hidden answers): Bind jQuery UI autocomplete using .live()
Cheers Matt
You can't use 'live' on autocomplete, as far as I know.
Place your autocomplete options in a function that expects the field as parameter, on which you want to apply the autocomplete method.
function enable_autocomplete(InputField) {
$(InputField).autocomplete({
source: availableTags
});
}
Then, after cloning the field, call this function with the cloned field.
enable_autocomplete(ClonedField);
I've written you an easy example, what makes it much easier to understand what I am trying to say ;-)
Edit: I've written another example based on the combobox example from jQueryUIs website.