Calling Javascript function using observe_field


#1

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?


#2

Thomas S. wrote:

Has anyone done this sort of thing?

Why not just use the onchange event of the field?

Jonathan


#3

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