Hi, I''d like to use ''selection'' with :multiple=>true but allow selecting only two items from the list. is there any easy way in RoR or I have to use some javascript testing with onChange event? Thanks very much --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Abigail Headroom
2008-May-22 13:10 UTC
Re: allow selecting only two items in multiple selection box
If you want to give the user feedback immediately when he selects a second option, you need to use Javascript. It can on the other hand be generated by RoR using RJS (called by a remote_function), but it it probably easier just to put it directly in the onchange-handler as you suggested. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2008-May-22 17:48 UTC
Re: allow selecting only two items in multiple selection box?
On 5/22/08, pepa007 <richter.josef-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''d like to use ''selection'' with :multiple=>true but allow selecting > only two items from the list. is there any easy way in RoR or I have > to use some javascript testing with onChange event?http://www.webtricks.com/sourcecode/source_code.cfm?CodeID=16 (3 seconds on google) -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---