Thomas Snide
2006-Apr-28 21:09 UTC
[Rails] Calling Javascript function using observe_field
I''m trying to call a simple javascript function from within an observe_field. It is possible to replace the :url with :function to call a function. But since there are no examples, and I''ve tried a bunch of iterations, can someone show me sample syntax? I''d like to do something like: <%= observe_field :FormOptions1, :frequency => 0.25, :function => "javascript:tcsValidateInput001()" %> Has anyone done this sort of thing? -- Posted via http://www.ruby-forum.com/.
Jonathan Weiss
2006-Apr-28 21:16 UTC
[Rails] Calling Javascript function using observe_field
Thomas Snide wrote:> I''m trying to call a simple javascript function from within an > observe_field. It is possible to replace the :url with :function to > call a function. But since there are no examples, and I''ve tried a > bunch of iterations, can someone show me sample syntax? > > I''d like to do something like: > > <%= observe_field :FormOptions1, > :frequency => 0.25, > :function => "javascript:tcsValidateInput001()" %> > > Has anyone done this sort of thing? >Why not just use the onchange event of the field? Jonathan -- Jonathan Weiss http://blog.innerewut.de
Thomas Snide
2006-May-01 14:36 UTC
[Rails] Re: Calling Javascript function using observe_field
Thank you. That works. Jonathan Weiss wrote:> Thomas Snide wrote: >> >> Has anyone done this sort of thing? >> > > Why not just use the onchange event of the field? > > > Jonathan-- Posted via http://www.ruby-forum.com/.