Advertisement
ihris

Untitled

Mar 16th, 2011
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function changeInputs() {
  2.     var id = this.getID();
  3.     var selected = this.getSelected().get('value');
  4.     if (!id || !value) {
  5.         alert("NO ID or value " + id + '/' + value);
  6.         //no id. or no value so quit                                                                                                                                                                                                                                  
  7.         return;
  8.     }
  9.     $$('tr.input_' + id).each(function(input){
  10.         if (input.hasClass ('input_' + id  + '_'+ selected )){
  11.             alert('making visible');
  12.             input.setStyle ('visibility','visible');
  13.         }  else {
  14.             alert('making hidden');
  15.             input.setStyle ('visibility','hidden');
  16.         }
  17.     });
  18. }
  19. window.addEvent('domready',  function() {
  20.     alert("DOM READY");
  21.     var e =  $('building_costing_mechanism');
  22.     if (e) {
  23.         alert("has element");
  24.         e.addEvent('change',changeInputs.bind(e));
  25.     }else {
  26.         alert("No element");
  27.     }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement