Forum: Ruby on Rails problem in text_field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Maite .. (Guest)
on 2009-01-16 15:05
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")}"}
%></p>

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
Frederick C. (Guest)
on 2009-01-16 15:53
(Received via mailing list)
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
This topic is locked and can not be replied to.