# Observing textfields in a form (AJAX)

**URL:** <https://www.ruby-forum.com/t/observing-textfields-in-a-form-ajax/91178>\
**Category:** Rails\
**Created:** [April 5, 2007, 11:55am UTC](https://www.ruby-forum.com/t/observing-textfields-in-a-form-ajax/91178 "2007-04-05T11:55:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 5, 2007, 11:55am UTC](https://www.ruby-forum.com/t/observing-textfields-in-a-form-ajax/91178/1 "2007-04-05T11:55:00Z")

</div>

I have a problem and I don’t know where to begin with (yes, I’m a  
newbie ;-)):

I have an application that holds a graph (with nodes and edges). In  
the view the user enters data that is then converted to nodes and  
edges: Every formfield-value (in the view) represents a node. I want  
the user to use existens nodes if possible, so I’d like him be able to  
see suggestions of neighbouring node-names as soon as enters data in a  
formfield and changes to another one. It should be a little like the  
suggestions you get when you post an url to [del.icio.us](http://del.icio.us).

—view (form)—  
[http://pastie.textmate.org/51912](http://pastie.textmate.org/51912)

—model (method)—  
[http://pastie.textmate.org/51913](http://pastie.textmate.org/51913)

…the model-method mentioned outputs an array of strings like the  
following:  
my\_node.get\_neighbours  
=\> [“a\_node\_name”, “another\_node\_name”, “some\_node\_name”]

Can anyone point me to some example code where something similar is  
being made or to a useful documentation? Kind of got no clue where to  
begin.

Thanks a lot!

Saludos  
Javier
