Re:(RESOLVED, KIND OF) auto complete and after update elemen

Well, I did finally get the after_update_element to call my controller
action with the following syntax:

<%= text_field_with_auto_complete ( :customer, :company_name, { :size =>
“45” }, :after_update_element => “function(element,value){” +
remote_function( :url => {
:action
=> :get_customer_info }, :with =>
“‘customer=’+$F(‘customer_company_name’)”)

  • “}” ) %>

It finds the correct customer in the database, and then in the action I
am
rendering a template that consists of several javascript element updates
similar to the following:

document.getElementById(“po_customer_address”).value = ‘<%=
@found_customer.address %>’;

However, although this template is getting called (per the log files),
the
information that is found in the database in not getting updated via the
template parsing.

The frustrating part is this worked when I had the company names as
selects
and used observe fields.
I switched becuase there are several thousand records of customers and
that
was one huge select box.
Allowing the user to type made more sense.
However, now the information isn’t getting updated now, so maybe it
wasn’t
such a bad thing to have huge select boxes :wink:

Anyone have any idea why now the parsing of this template doesn’t update
the
information in the view page?

Thanks in advance,

~d

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs