sayoyo
February 2, 2006, 10:03pm
1
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
It's time to get stuff done with Yahoo Mail. Just add your Gmail, Outlook, AOL or Yahoo Mail to get going. We automatically organize all the things life throws at you, like receipts and attachments, so you can find what you need fast. Plus, we've got...
sayoyo
February 3, 2006, 6:15am
2
I’m not sure, but try adding square brackets like this:
select_tag(“form__list1[]”,
…
Estelle.
sayoyo
February 3, 2006, 3:11pm
3
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
[object
sayoyo
February 3, 2006, 3:27pm
4
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
sayoyo
February 3, 2006, 3:45pm
5
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 Y. [email protected] wrote:
html_options = {“size” => 5, “multiple” => true})
–
Cody F.
http://www.codyfauser.com
sayoyo
February 3, 2006, 4:03pm
6
It works:)!!! Thanks you and Thank you very much
!!!
— Cody F. [email protected] wrote:
following function:
action: index
protection around
Cody F.
http://www.codyfauser.com
Rails mailing list
[email protected]
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.
Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[object
sayoyo
February 3, 2006, 4:03pm
7
Hi Adam,
Finally, I understand how to make it works:) Thanks
you and Thank you very much !!!
Saiho
— Adam D. [email protected] wrote:
Hi,
options_for_select([“A”,“B”,“C”,“D”], selected =
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
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.
Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[object
sayoyo
February 3, 2006, 4:00pm
8
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 D. [email protected] wrote:
Hi,
options_for_select([“A”,“B”,“C”,“D”], selected =
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[object
sayoyo
February 3, 2006, 4:03pm
9
Hi, Estelle
It works:)!!! Thanks you and Thank you very much
!!!
Saiho
— Estelle W.
[email protected] wrote:
Hi,
select_tag(“form__list1”,
form__list1: “A”
http://mail.yahoo.com
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[object