I’m trying to use the results of an auto complete form in a field
observer. The problem is the value of the field is just a select item
in a UL. So if I have this:
I type ‘an’, select ‘Anderson High’ or whatever and the parameters
look like this:
“school”=>{“name”=>“an”}
My latest hack attempt was to have the observer render a
link_to_remote button (‘find school’) with the value of li.selected as
its id. Couldn’t get that to work.
When you submit the form, obviously the value of the school[name]
parameter is correct, so I’d like to know how I can recreate this
functionality in my field observer.
As an aside, I can’t find the documentation on the auto complete
helper in the API.
I’m trying to use the results of an auto complete form in a field
observer. The problem is the value of the field is just a select item
in a UL. So if I have this:
I guess onchange is not fired because the field is in the end set with
JavaScript. You’ll surely need to pass some JavaScript for
the :after_update_element hook of the rightmost optional parameter
completion_options. That JavaScript would do what you wanted to do
with the observe_field, which would be removed.
I guess onchange is not fired because the field is in the end set
with JavaScript. You’ll surely need to pass some JavaScript for
the :after_update_element hook of the rightmost optional parameter
completion_options. That JavaScript would do what you wanted to do
with the observe_field, which would be removed.
Let me add that with model_auto_completer[*] you could send back the
school ID instad of the name via its own :after_update_element hook.
Depending on the data that would be a better way to get the list of
students of the school.