On Mon, Aug 14, 2006 at 06:33:28PM -0400, Colin Angevine wrote:
> I took a look at the example on the Scriptaculous site and I'm still a
> bit unclear. I'm already using the informal class, and it makes good
> sense to use it again (with a display:none there) but I'm not sure how
> I'll be able to retrieve that id number once the user selects it. Just
> a bit more context around how you approached it (or maybe a peek at
> the code you put together) would be wonderful.

You must use a callback (with updateElement option to
Ajax.Autocompleter) and that callback does something like
id = chosen_option.getElementsByTagName("span")[0].innerHTML;
then you can use the id as you like.

Previously discussed on the list:
http://lists.rubyonrails.org/pipermail/rails-spinoffs/2006-July/004864.html

Saludos,
                                        HoraPe
---
Horacio J. Peña
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to