Using :function with observe_field helper

I am trying to use observe_field to get the famous 37signals YFT effect
on form fields as they are modified. So, in effect, I want to detect
that a field has changed, and then cause the Prototype Highlight effect
to happen on that field.

I am trying to do it using a statement like this:

<%= observe_field(“preferences_x”,
:function => visual_effect(:highlight, “preferences_x”)) %>

which generates:

I can sort of see that what I’ve provided for the function parameter is
not correct. But to be honest, I’m not exactly sure what the problem is
here.

Has anyone successfully used the :function argument to observe_field?

Thanks,
Wes

I wanted to be able to call observe_field in a loop to set up
script.aculo.us effects on all of the form fields in my form.

But I couldn’t get it to work, so I just threw identical onChanges on
each field.

If anyone has ever successfully used the :function option to
observe_field, I’d love to understand how it’s done.

Thanks,
Wes