Saiho Yuen
2006-Feb-02 21:02 UTC
[Rails] How to get all selected rows in the mutli-selection listbox?
Hi,
I have created a multiple selection listbox with
rails, when I try to get the rows selected by user,
rails send back only the first one, how can I get the
other selected rows????
I created the listbox with the following function:
select_tag("form__list1",
options_for_select(["A","B","C","D"],
selected = "A"),
html_options = {"size" => 5, "multiple" => true})
What I get from params is :
!map:HashWithIndifferentAccess
commit: Next
action: index
controller: cellfiles
form__list1: "A"
Thanks you very much
Saiho
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Estelle Winterflood
2006-Feb-03 05:14 UTC
[Rails] How to get all selected rows in the mutli-selection listbox?
I''m not sure, but try adding square brackets like this:
select_tag("form__list1[]",
...
Estelle.
On 2/2/06, Saiho Yuen <sayoyo@yahoo.com> wrote:> Hi,
>
> I have created a multiple selection listbox with
> rails, when I try to get the rows selected by user,
> rails send back only the first one, how can I get the
> other selected rows????
>
> I created the listbox with the following function:
>
> select_tag("form__list1",
>
options_for_select(["A","B","C","D"],
selected = "A"),
> html_options = {"size" => 5, "multiple" => true})
>
> What I get from params is :
>
> !map:HashWithIndifferentAccess
> commit: Next
> action: index
> controller: cellfiles
> form__list1: "A"
>
> Thanks you very much
>
>
> Saiho
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Saiho Yuen
2006-Feb-03 14:11 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
Hi,
I have created a multiple selection listbox with
rails, when I try to get the rows selected by user,
rails send back only the first one, how can I get the
other selected rows???? I created the listbox with the
following function:
select_tag("form__list1",
options_for_select(["A","B","C","D"],
selected = "A"),
html_options = {"size" => 5, "multiple" => true})
What I get from params is :
!map:HashWithIndifferentAccess
commit: Next
action: index
controller: cellfiles
form__list1: "A"
Thanks you very much
Saiho
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Adam Denenberg
2006-Feb-03 14:24 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
hmm you might need to do something like form_list1[] instead of just form_list1 to get all the values into an array. try that adam On 2/3/06, Saiho Yuen <sayoyo@yahoo.com> wrote:> > Hi, > I have created a multiple selection listbox with > rails, when I try to get the rows selected by user, > rails send back only the first one, how can I get the > other selected rows???? I created the listbox with the > following function: > > select_tag("form__list1", > options_for_select(["A","B","C","D"], selected = "A"), > html_options = {"size" => 5, "multiple" => true}) > > What I get from params is : > > !map:HashWithIndifferentAccess > commit: Next > action: index > controller: cellfiles > form__list1: "A" > > Thanks you very much > > Saiho > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Cody Fauser
2006-Feb-03 14:44 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
Saiho,
Try this:
select_tag(''letters[]'',
options_for_select([''A'',''B'',''C'',''D''],
''A''),
:size => 5, :multiple => true)
You need to add the [] to the name to get back an array of selected values.
On 2/3/06, Saiho Yuen <sayoyo@yahoo.com> wrote:>
> Hi,
> I have created a multiple selection listbox with
> rails, when I try to get the rows selected by user,
> rails send back only the first one, how can I get the
> other selected rows???? I created the listbox with the
> following function:
>
> select_tag("form__list1",
>
options_for_select(["A","B","C","D"],
selected = "A"),
> html_options = {"size" => 5, "multiple" => true})
>
> What I get from params is :
>
> !map:HashWithIndifferentAccess
> commit: Next
> action: index
> controller: cellfiles
> form__list1: "A"
>
> Thanks you very much
>
> Saiho
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Cody Fauser
http://www.codyfauser.com
Saiho Yuen
2006-Feb-03 14:58 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
Hi,
I try this but, it doesn''t work
form__list1 = []
select_tag(form__list1,
options_for_select(["A","B","C","D"],
selected ="A"),
html_options = {"size" => 5, "multiple" => true})
I get only A even I chose A,B,C
!map:HashWithIndifferentAccess
"": "A"
commit: Previous
action: index
controller: atlasmain
have any idea???
Thanks you very much!!!
Saiho
--- Adam Denenberg <straightflush@gmail.com> wrote:
> hmm you might need to do something like form_list1[]
> instead of just
> form_list1 to get all the values into an array.
>
> try that
>
> adam
>
> On 2/3/06, Saiho Yuen <sayoyo@yahoo.com> wrote:
> >
> > Hi,
> > I have created a multiple selection listbox with
> > rails, when I try to get the rows selected by
> user,
> > rails send back only the first one, how can I get
> the
> > other selected rows???? I created the listbox with
> the
> > following function:
> >
> > select_tag("form__list1",
> >
options_for_select(["A","B","C","D"],
selected > "A"),
> > html_options = {"size" => 5, "multiple" =>
true})
> >
> > What I get from params is :
> >
> > !map:HashWithIndifferentAccess
> > commit: Next
> > action: index
> > controller: cellfiles
> > form__list1: "A"
> >
> > Thanks you very much
> >
> > Saiho
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> > _______________________________________________
> > Rails mailing list
> > Rails@lists.rubyonrails.org
> >
> http://lists.rubyonrails.org/mailman/listinfo/rails
> >
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Saiho Yuen
2006-Feb-03 15:00 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
It works:)!!!!! Thanks you and Thank you very much !!!! --- Cody Fauser <codyfauser@gmail.com> wrote:> Saiho, > > Try this: > > select_tag(''letters[]'', > options_for_select([''A'',''B'',''C'',''D''], ''A''), > :size => 5, :multiple => true) > > You need to add the [] to the name to get back an > array of selected values. > > On 2/3/06, Saiho Yuen <sayoyo@yahoo.com> wrote: > > > > Hi, > > I have created a multiple selection listbox with > > rails, when I try to get the rows selected by > user, > > rails send back only the first one, how can I get > the > > other selected rows???? I created the listbox with > the > > following function: > > > > select_tag("form__list1", > > options_for_select(["A","B","C","D"], selected > "A"), > > html_options = {"size" => 5, "multiple" => true}) > > > > What I get from params is : > > > > !map:HashWithIndifferentAccess > > commit: Next > > action: index > > controller: cellfiles > > form__list1: "A" > > > > Thanks you very much > > > > Saiho > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >If God really exists, I would like to know what the dinosaurs have done to deserve their extinction. Water is unknown to fishes, until they discover air. http://www.geocities.com/sayoyo/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Saiho Yuen
2006-Feb-03 15:02 UTC
[Rails] help!!! How to get all selected rows in the mutli-selection listbox? 2e try
Hi Adam, Finally, I understand how to make it works:) Thanks you and Thank you very much !!!! Saiho --- Adam Denenberg <straightflush@gmail.com> wrote:> hmm you might need to do something like form_list1[] > instead of just > form_list1 to get all the values into an array. > > try that > > adam > > On 2/3/06, Saiho Yuen <sayoyo@yahoo.com> wrote: > > > > Hi, > > I have created a multiple selection listbox with > > rails, when I try to get the rows selected by > user, > > rails send back only the first one, how can I get > the > > other selected rows???? I created the listbox with > the > > following function: > > > > select_tag("form__list1", > > options_for_select(["A","B","C","D"], selected > "A"), > > html_options = {"size" => 5, "multiple" => true}) > > > > What I get from params is : > > > > !map:HashWithIndifferentAccess > > commit: Next > > action: index > > controller: cellfiles > > form__list1: "A" > > > > Thanks you very much > > > > Saiho > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >If God really exists, I would like to know what the dinosaurs have done to deserve their extinction. Water is unknown to fishes, until they discover air. http://www.geocities.com/sayoyo/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Saiho Yuen
2006-Feb-03 15:02 UTC
[Rails] How to get all selected rows in the mutli-selection listbox?
Hi, Estelle It works:)!!!!! Thanks you and Thank you very much !!!! Saiho --- Estelle Winterflood <estelle.winterflood@gmail.com> wrote:> I''m not sure, but try adding square brackets like > this: > > select_tag("form__list1[]", > ... > > Estelle. > > > On 2/2/06, Saiho Yuen <sayoyo@yahoo.com> wrote: > > Hi, > > > > I have created a multiple selection listbox with > > rails, when I try to get the rows selected by > user, > > rails send back only the first one, how can I get > the > > other selected rows???? > > > > I created the listbox with the following function: > > > > select_tag("form__list1", > > options_for_select(["A","B","C","D"], selected > "A"), > > html_options = {"size" => 5, "multiple" => true}) > > > > What I get from params is : > > > > !map:HashWithIndifferentAccess > > commit: Next > > action: index > > controller: cellfiles > > form__list1: "A" > > > > Thanks you very much > > > > > > Saiho > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com