I have 2 select tags that are wrapped to model attributes. I would like for one of them to always be NULL. From my limited knowledge, I think this would be the best way to do it: When one option is selected, the other select tag is ''reset'', and vice versa. That way it would be possible for one of the select tags to always be unselected. Anyone know of an simple snippet for this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Matt Foster
2007-Aug-03 01:09 UTC
Re: Set select_tag to blank when another select_tag is selected?
Listen to onchange events and modify the selectedIndex property of the select box, have your null option as the first one and then you could reset things by setting it to zero. On Aug 2, 8:41 pm, jko170 <jko...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have 2 select tags that are wrapped to model attributes. I would > like for one of them to always be NULL. From my limited knowledge, I > think this would be the best way to do it: When one option is > selected, the other select tag is ''reset'', and vice versa. That way it > would be possible for one of the select tags to always be unselected. > Anyone know of an simple snippet for this?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---