I need to use autocomplete (In particular I try it with this plugin http://scottreeddesign.com/project/jsuggest) in my text input that it is in a facebox. But it didn't work beacause in the document ready there is my function:
$(document).ready( function(){
/** suggest new Quid **/
$('#idInput').jSuggest({
default_text: 'Inserisci il quid',
terms_url: 'data.php'+'%input%',
limit: 10
});
$('#idLink').live('click', function(e) { jQuery.facebox("<input type='text' id='idInput' />") });
});
but initially the dom #idInput don't exist, it is show in the facebox only when I click a link.
Can you help me? Any suggestion?
p.s. the plugin jsuggest isn't required. It is the first that I've found.
the solution is bind the jSuggest plugin right on the click event:
or maybe better:
EDIT: the solutions above doesn't work then try this:
Anyway I would suggest you to use jquery-ui's autocomplete.