jQuery UI Autocomplete with jsfiddle echo json
http://bugs.jqueryui.com/ticket/7230
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/base/jquery-ui.css">
this jsfiddle just to test 1 functionnality.<br>
i need to have an autocomplete from a data and have result<br>
in other area than the autocomplete input<br>
how to say to autocomplete to report result in another area.?<br>
and let input area keep initial content?<br>
the behavior needed is simulated with timeout.<br>
en francais.<br>
j'ai besoin d'une fonction autocomplete à partir d'une saisie<br> mais qui laisse le champ de saisie intacte et reporte le resultat selectionné dans un autre champ.<br>
comment dire à l'autocomplete de faire ca.? <br>j'ai simulé le comportement voulu avec des timeout.<br>
<br><br>
Saisie: <input type="text" id="autocomplete" value=""></input>just type 1 to autocomplete and select 21<br>
Result: <input type="text" id="result" value=""></input>
<input style="display:none;" id="tagville" />
CSS
body{font:62.5% Verdana,Arial,sans-serif;}
JavaScript
$( "#autocomplete" ).autocomplete({
source: function( req, resp ) {
$.post( "/echo/json/", {
json: '["11", "21", "31", "41", "51"]',
delay: 1
}, function(data) {
resp( data );
}, "JSON" );
},
select: function(evt, ui){
$('#result').val(ui.item.label);
}
,
change: function(){
// alert('change');
}
,
close: function(){
// alert('close');
}
});