In the end, I think I've found my own solution. I need to make these
changes in a subform, so I took a copy of
_horizontal_subform_header.html.erb from Vendor/plugins/
active_scaffold/frontends/default/views and placed it in views folder
of my controller.

I left the HTML of this erb unchanged and just added at the top my
script ...

<script type="text/javascript">
document.observe('dom:loaded', function() {  //do it once everything's
loaded
  //grab all the product-input classes and call 'observe' on them :
  $$('.product-input').invoke('observe', 'change', function(e) {
    this.up('td').next('td').down('input').hide();
  });
});
</script>




On Dec 6, 1:08 pm, ruinen <[email protected]> wrote:
> I have a Select dropdown on the form of an ActiveScaffold. I am trying
> to hide some of the fields on the form if a particular value.
>
> A similar question was already posted to the ActiveScaffold Google
> Group [http://groups.google.com/group/activescaffold/browse%5Fthread/
> thread/a298a48cf4ff0a1c/241feec5dd169153], and the supplied Prototype
> code looks to do what I need, however I don't know where I need to add
> this.

--

You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.


Reply via email to