Hi, Can you please specify the in detail the observe_field that you have used for 2x radio buttons??
Im also facing the same problem. My observe field is working fine for 3 radio buttons but for 3 I dont understand hoe to make it work?? krunk- wrote: > Setup: > > A form which initially has only one field: a 2x group of radio_buttons. > As the user selects options, additinal fields are added or removed. > > I started with observe_field. I was getting some very peculiar behavior > from observe_field and finally figured out why => > > Observe field only works for the first click. So it's not suitable for > a form that reacts to user input since a user may select/unselect an > option multiple times. > > Next, I decided to use observe_form. At first, it seemed to overcome > the problems of observe_field and reacted to every click of the > radio_button. But then I discovered that it doesn't observe changes in > fields that are not in the original source (the fields added by the > user). So I'm back to ground zero. > > I suppose I could build all the DOM objects from scratch and roll my > own functions for adding/removing and call them via onclick(), but I > was hoping to get away from some of the: > > var myDiv = document.createElement('div'); > var link = document.createElement('a'); > link.setAttribute('href', 'somepage.php'); > var text = document.createCreateTextNode('Link Name'); > > link.appendChild(text); > myDiv.appendChild(link); > > in lieu of rjs goodness like: > myElement = "<div><a href='somepage.php'>Link Name</a></div>" > page.replace_html :elementId, myElement > > > Any help appreciated -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---