The observe_field
AJAX helper allows to observe one field; if there is a change, it calls the specified method on the server side. It is possible to attach one value for the call.
This is enough if we have one text box search for searching over multiple columns or for a full-text search.
For a more complicated filtering functionality with more fields there are two main problems with the observe_field
helper:
- how to specify more parameter values in the observe_field helper.
- it is necessary to write a observe_field call for each field.
Added: Thanks to Ryan Bate and Benjamin, I found out there is a helper for the whole form: the observe_form
helper. Basically my post is useless, except a few situations: if a form contains a lot of items and you would not like to send them all, or, and I am not 100% sure about this, if a form contains a file field (the file_field
helper).
Let’s create a special observe_fields
helper that will handle all this problems :)
(There is more where this came from … )