# How can I get other field value?

**URL:** <https://www.ruby-forum.com/t/how-can-i-get-other-field-value/157376>\
**Category:** Rails\
**Created:** [January 10, 2009, 7:35am UTC](https://www.ruby-forum.com/t/how-can-i-get-other-field-value/157376 "2009-01-10T07:35:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [January 10, 2009, 7:35am UTC](https://www.ruby-forum.com/t/how-can-i-get-other-field-value/157376/1 "2009-01-10T07:35:02Z")

</div>

I use this code to get other field value:

\<%= hidden\_field\_tag ‘project\_version\_select’,  
$(‘other\_id’).getValue()%\>

but I got compile error. How can I get the value?

---

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [January 10, 2009, 8:15am UTC](https://www.ruby-forum.com/t/how-can-i-get-other-field-value/157376/2 "2009-01-10T08:15:22Z")

</div>

Hi,

You need to add the hidden\_field first without a value and then set the  
value of it using script tag

NAYAK

On Sat, Jan 10, 2009 at 12:05 PM, Zhao Yi  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> >

–

- NAYAK
