Thank you both for your responses.
Christophe,
It looks like it's working but there's one problem. The
'returngoeshere' only updates after you click somewhere on the page
instead of as soon as you finish typing. Here's what it all looks like.
<input type="text" id="textgoeshere"/>
<div id="returngoeshere"></div>
<script type="text/javascript">
function fetchDataFromServer(elt, value) {
new Ajax.Updater('returngoeshere', 'processingfile', {
parameters: 'yourServerField=' + encodeURIComponent(value)
});
} // fetchDataFromServer
new Form.Element.EventObserver('textgoeshere', fetchDataFromServer);
</script>
The processingfile recieves the POST['yourServerField'] variable and
displays it.
Also, shouldn't Autocompleter do exactly what I'm after? According to
the wiki, Autocompleter is to be used like so:
new Ajax.Autocompleter(id_of_text_field, id_of_div_to_populate, url,
options);
So wouldn't having just "textgoeshere" for id_of_text_field and
"returngoeshere" for id_of_div_to_populate work?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---