Hi, i hope that''s the correct place for this question. I must update two input text from autocomplete. The list is, for exemple: <ul> <li> <span class="comune_name">pippo</span> <span class="lat" style="display:none">1.2</span> <span class="long" style="display:none">3.0</span> </li> </ul> I want in <input id="inputlat" type="text" value="-" /> the value 1.2 and in <input id="inputlong" type="text" value="-" /> the value 3.0 I have used auto_complete_on_select but not work.Any suggestion? The code is: function auto_complete_on_select(element, selectedElement) { document.getElementById(''inputlat'').value = selectedElement.childNodes.item.getElementsByTagName(''span'')[0].innerHTML; document.getElementById(''inputlong'').value = selectedElement.childNodes.item.getElementsByTagName(''span'')[1].innerHTML; } <input name="comune" class="autocomplete" id="autocomplete" size="20" type="text" onkeyup="new Ajax.Autocompleter(''autocomplete'', ''autocomplete_choices'', ''list.php'', {minChars: 2,afterUpdateElement: auto_complete_on_select} );"/> <br/> lati: <input id="inputlat" type="text" value="-" /> <br/> long: <input id="inputlong" type="text" value="-" /> Thanks in advance max -- Posted via http://www.ruby-forum.com/.