I already have an onblur with the text field and another with the select field. This works fine, but I don`t know how to represent in the select list the corresponding name of the code typed in the text field.
2009/8/6 Me <[email protected]> > > You probably need to put the select into a partial and then refresh > the partial when you return from the observe field. I would probably > go with an ajax "on blur" with the text field as this would put a bit > less load on the server. > > On Aug 6, 2:06 pm, FF <[email protected]> wrote: > > Hi all, > > I have two fields in a form. > > One text field non asociated to the model for the user type a value. > > the > > view is: > > <%= text_field_tag 'item_cod','', :size => 3 %> > > > > Other a field with a select list with codes, names for the user > > select > > from. The view is: > > > > <%= f.select :item_id, Item.select_list, :size => 40 %> > > > > item_id is the real field of my model. > > > > I want the following behavior. > > 1. If the user type a code into the text_field tag -> Update the list > > so > > the user view the corresponding name of the item they type. > > 2. If the user select from the list -> Update the text field with > > the > > code corresponding to the name selected. (this is the easy part) > > > > My form works fine with one Observe field for the :item_id list but > > I > > can't do work the point 1. > > > > Thanks in advance, > > FF > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

