Forum: Ruby on Rails observe_field on focus

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
19d3423787ee00b6c0689342151da91f?d=identicon&s=25 ray (Guest)
on 2007-02-08 00:36
(Received via mailing list)
According to the Rails documentation, the following should pop an
alert on focus:

  <%= observe_field :search_box, :function => "alert(value);", :on
=> :focus %>

However, the alert still pop on changed.  The generated prototype call

  new Form.Element.EventObserver('search_box', function(element,
value) {alert(value);}, 'focus')

Looking at prototype.js 1.5.0, it does not seem to take the 'focus'
parameter.  Is observe_field broken?  Or am I doing something wrong?
This topic is locked and can not be replied to.