# Many check\_boxes

**URL:** <https://rubytalk.org/t/many-check-boxes/25942>\
**Category:** ruby-talk\
**Created:** [20 March 2006 21:18 UTC](https://rubytalk.org/t/many-check-boxes/25942 "2006-03-20T21:18:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![misiek](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@misiek](https://rubytalk.org/u/misiek)\
**Post date:** [20 March 2006 21:18 UTC](https://rubytalk.org/t/many-check-boxes/25942/1 "2006-03-20T21:18:50Z")

</div>

I need use check\_box to search function.

sample..

I got like 10 items and each item has over 10 subitems ( or whatever )  
Need to check some items use check\_boxes and display all subitems belongs to checked items.

\<%= start\_form\_tag :action =\> 'find\_ckecked'%\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<table width = "100%" \>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% @uitems.each do |item| %\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<tr bgcolor = "lightgray"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= check\_box("item", "name" ) %\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= [item.name](http://item.name) %\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</td\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</tr\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= submit\_tag "search" %\>  
\<%= end\_form\_tag %\>

I have no ideas how to do that please if some body did that before could give some clues ?!

---

<div class="post-metadata">

**Author:** ![Dave\_Burt2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/dave_burt2/32/2036_2.png) [@Dave\_Burt2](https://rubytalk.org/u/Dave_Burt2)\
**Post date:** [21 March 2006 04:03 UTC](https://rubytalk.org/t/many-check-boxes/25942/2 "2006-03-21T04:03:50Z")

</div>

misiek wrote:

> I need use check\_box to search function.  
> ...  
> \<%= start\_form\_tag :action =\> 'find\_ckecked'%\>  
> ...

Hi,

This specifically Rails question is off-topic here. Try the Rails list:  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

You'll get better answers for Rails questions like this there.

In direct answer to your question, you probably want to toggle the display  
property of the children between "none" and "" (default). The  
JavascriptHelper might be of use:  
[http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html](http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html)

Cheers,  
Dave
