# Problem in text\_field

**URL:** <https://www.ruby-forum.com/t/problem-in-text-field/157906>\
**Category:** Rails\
**Created:** [January 16, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/problem-in-text-field/157906 "2009-01-16T14:05:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 16, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/problem-in-text-field/157906/1 "2009-01-16T14:05:06Z")

</div>

hello everybody

I have this text\_field

\<%= f.text\_field :precio\_compra, {:size=\> 10, :onchange =\>  
“#{remote\_function(:url=\>{:controller=\> “accions”, :action=\>  
“comprueba”},:with =\> “‘valor=’+ ‘accion[precio\_compra]’.value”)}”}  
%\>

but in comprueba funtion i have this

=\> {“authenticity\_token”=\>“ea3bfcd9b5acd6ffbaf6d4b57850f58fd0dcf734”,  
“valor”=\>“undefined”, “action”=\>“comprueba”, “controller”=\>“accions”}

> >

valor=\> “undefine”

How I pass the text\_field value???

thanks for all

---

<div class="post-metadata">

**Author:** ![maite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e495f1/32.png) [@maite](https://www.ruby-forum.com/u/maite)\
**Post date:** [January 16, 2009, 2:53pm UTC](https://www.ruby-forum.com/t/problem-in-text-field/157906/2 "2009-01-16T14:53:27Z")

</div>

On 16 Jan 2009, at 13:05, Maite P. wrote:

> but in comprueba funtion i have this
> 
> =\> {“authenticity\_token”=\>“ea3bfcd9b5acd6ffbaf6d4b57850f58fd0dcf734”,  
> “valor”=\>“undefined”, “action”=\>“comprueba”, “controller”=\>“accions”}
> 
> > >
> 
> valor=\> “undefine”
> 
> How I pass the text\_field value???

Assuming foo was the id of the element you’d want $F(‘foo’) instead of  
‘accion[precio\_compra]’.value which is basically meaningless to  
javascript.

Fred
