# Drop down list box button

**URL:** <https://www.ruby-forum.com/t/drop-down-list-box-button/125415>\
**Category:** Rails\
**Created:** [January 8, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/drop-down-list-box-button/125415 "2008-01-08T22:51:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 8, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/drop-down-list-box-button/125415/1 "2008-01-08T22:51:27Z")

</div>

Is is necessary to have a button here?

**Repuestos**  
 \<% @rp\_parts.each do |rp\_part| %\> \> \<%= rp\_part.name%\> \<% end %\>

I want to capture @repair\_ticket.rp\_item without a button.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 9, 2008, 12:12pm UTC](https://www.ruby-forum.com/t/drop-down-list-box-button/125415/2 "2008-01-09T12:12:48Z")

</div>

just add the onchange=“this.form.submit();” like you would normally,  
since you aren’t using the form helpers properly to build the select  
box. It will have to be within a tag though  
You can add your ajax to the onsubmit handler of the form tag.

Seriously, though, this is not good rails development, please check  
out the “best practice” ways to do things like this before hacking  
your own solutions. It’s not PHP!

[http://www.authomedia.co.uk/dev/repairs.zip](http://www.authomedia.co.uk/dev/repairs.zip)

Joe

On Jan 8, 9:51 pm, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
