Enrico Teotti
2005-Oct-12 08:50 UTC
text_field_with_autocomplete return values to more DOM objects
Hi, I''was looking at the scriptaculous autocomplete customized example where you load the email addressbook. <%= text_field_with_auto_complete :message, :to, {}, :skip_style => true %><br/> what the partial does is to load the names emails and pics. # _contacts.rhtml partial <ul class="contacts"> <% for contact in @contacts do -%> <li class="contact"> <div class="image"> <img src="/demos/images/contacts/<%= contact.id.to_s[-1,1] %>.jpg"/> </div> <div class="name"><%=h contact.name %></div> <div class="email"> <span class="informal"><%=h contact.email %></span> </div> </li> <% end -%> in the end the autocomplete is just on :message :to so if I need the email address or the contact id how can I get it? I could assume the field (in this example the email address) is unique... but maybe not. I could put the email address toghether with the name in the text field as gmail do, but I''would like to have a more dinamic way like after I choose the item in the ul to being able to return values in to more DOM objects (like text fields)... I''m wondering if this is already possible someway. Sorry for my bad english. Thanks, Enrico -- "The only thing necessary for the triumph of evil is for good men to do nothing" Edmund Burke