That's fine, but Rails normally includes the prototype libs, so you could have done it in one line:
:onclick => "ELEMENT_NAME.hide();return false" On Feb 13, 12:24 pm, "Patrick G." <li...@ruby-forum.com> wrote: > I don't like self-answered posts... > > I've found a solution. I have created a simple javascript: > > <script type="text/javascript"> > function switchvisibility(el) { > if (document.getElementById(el).checked) { > document.getElementById('wvdatetime').style.display = "table-row"; > } else { > document.getElementById('wvdatetime').style.display = "none"; > } > } > </script> > > my checkbox in the form has > :id => "thiselement", :onchange => "switchvisibility('thiselement')" > > and the table row I want do hide has: > <tr id="wvdatetime" style="display: none;"> ....</tr> > > That's it. I hope the solution is not too stupid. > > Patrick > -- > Posted viahttp://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-t...@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.