Forum: Ruby on Rails Calling Javascript function using observe_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.
Thomas S. (Guest)
on 2006-04-29 01:03
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?
Jonathan W. (Guest)
on 2006-04-29 01:17
(Received via mailing list)
Thomas S. wrote:
>
> Has anyone done this sort of thing?
>

Why not just use the onchange event of the field?


Jonathan
Thomas S. (Guest)
on 2006-05-01 18:35
Thank you.  That works.


Jonathan W. wrote:
> Thomas S. wrote:
>>
>> Has anyone done this sort of thing?
>>
>
> Why not just use the onchange event of the field?
>
>
> Jonathan
This topic is locked and can not be replied to.