# GET the next INPUT element in a table TR

**URL:** <https://www.ruby-forum.com/t/get-the-next-input-element-in-a-table-tr/142881>\
**Category:** Rails\
**Created:** [July 12, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/get-the-next-input-element-in-a-table-tr/142881 "2008-07-12T16:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [July 12, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/get-the-next-input-element-in-a-table-tr/142881/1 "2008-07-12T16:40:52Z")

</div>

Hello,

My app has an order. This order has products, which is chosen in a  
select list.

each product is added by a partial like this:

1. 
2. 
3. product1
4. 
5. 
6. 
7. 
8. 

“Onchange” a product, the price is updated via ajax using rjs. thats  
OK.  
but, when I add another product, it update the first product price, of  
course, because it have the same name and ID. But I can not change  
this, so is there some way to get the next input element via  
javascript? Selecting the next input element or something like this.

thnks a lot!!!

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [July 12, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/get-the-next-input-element-in-a-table-tr/142881/2 "2008-07-12T19:06:33Z")

</div>

Have a look at jQuery, it’s great for stuff like this.

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [July 12, 2008, 11:35pm UTC](https://www.ruby-forum.com/t/get-the-next-input-element-in-a-table-tr/142881/3 "2008-07-12T23:35:34Z")

</div>

I did search for this at jquery but i can´t find this stuff… could  
you show me how?

On 12 jul, 14:06, Max W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
