Hi Ruud Hmm - I've never used observe_field to call a js function, usually just for rails-ajax calls.
If I were calling a js function like so, I'd normally just add :onclick => 'date_clicked(true)' to the radio buttons. There should be a way to call the js function using observe_field though so let's try and find it? Why not try simplifying the function call first, with something like :function => "alert('this works')" just to check if this is where the problem is? what do you have in the date_clicked() function now? On Feb 27, 5:51 pm, ruud <r.grosm...@gmail.com> wrote: > hi Gavin, > > I inserted two observe_field calls, essentially replacing the onclick > values on the radio button tags. But it turns out that only the first > time a radio button is clicked, the :function of the observer is > called. So if I switch back, nothing happens. It does if I reload the > page. > Do I miss something in the documentation? > > regards, Ruud > > [ options hash delete from input tags] > [inserted] > <%= observe_field( :date_none, :function => 'date_clicked(true)') > %> > <%= observe_field( :date_with, :function => 'date_clicked(false)') > %> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---