Forum: Ruby on Rails auto_complete_on_select don't work correctly

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Max B. (Guest)
on 2006-03-29 19:02
Hi, i hope that's the correct place for this question.
I must update two input text from autocomplete. The list is, for

  <span class="comune_name">pippo</span>
  <span class="lat" style="display:none">1.2</span>
  <span class="long" style="display:none">3.0</span>

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 =
	document.getElementById('inputlong').value =

        <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
This topic is locked and can not be replied to.