Field_observer :on

I need a prototype/javascript guru to take a peek at this.

There’s been discussions about prototype.js missing full support for
the :on parameter to field_observer
eg this is ignored, and always defaults to on “change”, whether you
use “focus”, “keyup” , “blur” whatever

<%= observe_field ‘foo’, :on => “focus”, :function => ‘
(“foobar”)’ %>

here’s some background:
b297e6e10c1989fc?hl=en (discusses “blur”)
prototype (specific to “focus”) (general

The joshhuckabee article seems the best generalized solution, gives a
patch to prototype.js

but seems out of date w/r/t Rails 2.0 prototype.js When I add the
patch, FireBug goes into an infinite loop adding errors:

Form.Element.getValue is not a function
return Form.Element.getValue(this.element);

It’s probably a simple fix to get it to work again. But I dont know
js that well…


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs