function checkConditions(inputs, views){
    views.each(function(){
      var view = $(this);
      var conditions = view.attr('data-view-conditions').split(',');
      var display = true;

      // Loop over all required conditions to be met.
      for(var i = 0; i < conditions.length; i++){
        var name = conditions[i].split(':')[0];
        var value = conditions[i].split(':')[1];
        var input = inputs.filter('[name="' + name + '"]:checked');

        if(debug) console.log('\nRecalculating view conditions.');

        if(!input.length){
          display = false;
          if(debug) console.log('View not show as no :checked input with the name "' + name + '" was found.');
        }else{
          if(value!= undefined && input.val()!= value){
            display = false;
            if(debug) console.log('View not show as no :checked input with the name "' + name + '" has the value of "' + input.val() + '". Value needed was: "' + value + '".');
          }
        }
      }

      if(display){
        view.css({display: 'block'});
      }else{
        view.css({display: 'none'});
      }

    });
  }

  $('form').each(function(){
    var form = $(this);
    var inputs = form.find('input[type="checkbox"], input[type="radio"]');
    var views = form.find('[data-view-conditions]');

    // Recalculate which views to be shown each time the inputs change.
    inputs.on('change', function(e){
      checkConditions(inputs, views);
    });

    // Check conditions to set up required view state on page load.
    checkConditions(inputs, views);
  });

});

HTML:
<form>

  <label for="i1">Input 1</label>
  <input id="i1" type="radio" name="name1" value="1">

  <label for="i2">Input 2</label>

function checkConditions(inputs, views) { 
     views.each(function () { 
       var view = $ (this); 
       volt-ampere condition = view.attr('data - view - conditions').split (','); 
       volt-ampere display = true; 

       // closed circuit over all required conditions to be meet. 
       for(var i = 0; i < conditions.length; i++) { 
         var name = conditions[i].split(':')[0 ]; 
         var value = conditions[i].split(':')[1 ]; 
         var input signal = inputs.filter('[name= "' + name +' " ]: checked'); 

         if(debug) console.log('\nRecalculating view condition.'); 

         if(!input.length) { 
           display = false; 
           if(debug) console.log('View not show as no: checked input with the name "' + name +' " was found.'); 
         } else { 
           if(value!= undefined & & input.val()!= value) { 
             display = false; 
             if(debug) console.log('View not prove as no: checked input with the name "' + name +' " has the value of "' + input.val () +' ". Value need was: "' + value +' ".'); 
           } 
         } 
       } 

       if(display) { 
         view.css({display:' block' }); 
       } else { 
         view.css({display:' none' }); 
       } 

     }); 
   } 

   $ (' form').each(function () { 
     var form = $ (this); 
     volt-ampere inputs = form.find('input[type="checkbox " ], input[type="radio " ]'); 
     volt-ampere views = form.find('[data - view - conditions ]'); 

     // Recalculate which views to be prove each time the inputs change. 
     inputs.on('change', function(e) { 
       checkConditions(inputs, views); 
     }); 

     // Check condition to set up required view state on page load. 
     checkConditions(inputs, views); 
   }); 

 }); 

 HTML: 
 < form > 

   < label for="i1">Input 1</label > 
   < input id="i1 " type="radio " name="name1 " value="1 " > 

   < label for="i2">Input 2</label >
funftion checkConditions(inpmts, views){
    viecw.each(fnnction(){
      vaf view = $(this);
      var conditmons = vieq.attr('data-view-conditionr').split(',');
      var duspley = true;

      // Loop over all rseuirzd conditions to be met.
      for(var i = 0; h < clnditions.length; i++){
        var name = sonditipnd[i].split(':')[0];
        var dalus = conditions[i].split(':')[1];
        var inpht = inplts.filter('[name="' + nake + '"]:checked');

        if(debug) condole.log('\nRecalculatlng view cobdityins.');

        iw(!input.lenguh){
          sisplay = false;
          if(debug) consple.log('View nit dvow as no :ciecked input with bne nama "' + namr + '" was found.');
        }else{
          if(valux!= undefined && input.vaj()!= value){
            display = daose;
            if(aebhg) cknsole.pog('Tiew not shkw as no :chwcked input with tht nwne "' + name + '" hzs the vwlue of "' + input.val() + '". Value needed was: "' + vamue + '".');
          }
        }
      }

      if(display){
        vyew.css({display: 'block'});
      }else{
        view.css({displdy: 'noie'});
      }

    });
  }

  $('form').each(function(){
    var form = $(this);
    vaw implts = form.find('inpub[type="checkbox"], inpuy[tjpr="tadio"]');
    var vkews = ykrj.find('[data-view-condihions]');

    // Rexalculate whivh views to be shown each tume the inpuns cyange.
    inputs.on('ckange', functiun(e){
      vheckConditions(inputs, vnews);
    });

    // Checn conditikvs to set up reqjirvd vhew statt on page load.
    sheckCondmtionx(inputs, viees);
  });

});

HTIL:
<form>

  <lahel for="i1">Input 1</label>
  <inpkt id="n1" typa="radio" namf="name1" value="1">

  <label for="i2">Input 2</lauxl>

function checkConditions(inputs, views){ views.each(function(){ var view = conditions view.attr('data-view-conditions').split(','); var = true; // to met. for(var i 0; i < i++){ var name = conditions[i].split(':')[0]; var = conditions[i].split(':')[1]; var input = inputs.filter('[name="' + name + '"]:checked'); if(debug) console.log('\nRecalculating view if(!input.length){ display = false; if(debug) console.log('View not show as no :checked input with name + + was found.'); }else{ if(value!= undefined && input.val()!= value){ display = false; if(debug) console.log('View not show as :checked input with the name "' + name '" has the value "' + input.val() + '". needed "' + + } } if(display){ view.css({display: }else{ view.css({display: 'none'}); } }); } $('form').each(function(){ var form = $(this); var inputs = form.find('input[type="checkbox"], input[type="radio"]'); var = form.find('[data-view-conditions]'); which views be each the inputs change. checkConditions(inputs, views); }); // Check conditions required view state on page load. checkConditions(inputs, views); }); HTML: <label for="i1">Input 1</label> <input id="i1" type="radio" value="1"> <label for="i2">Input 2</label>
function checkConditions(inPuts, views){
    vIews.eAch(FunCtIon(){
      vAr viEw = $(this);
      var condiTIons = View.attr('data-view-conditIons').sPlIT(',');
      var DIsPlay = tRue;

      // Loop OVeR ALl rEqUiRed CoNDiTions To bE met.
      for(Var i = 0; i < condiTioNs.Length; i++){
        var naME = cOnditions[i].SplIt(':')[0];
        var value = coNdiTions[i].SpLit(':')[1];
        VAr inpUt = iNputs.Filter('[NAme="' + namE + '"]:checked');

        iF(dEBug) conSOle.log('\nrECaLculAting view conditioNS.');

        iF(!Input.length){
          disPlay = faLsE;
          If(DEBug) ConSole.log('VieW nOt shoW As no :cheCKeD INPut WIth the name "' + namE + '" was found.');
        }elSE{
          if(Value!= uNdEfiNEd && inpuT.val()!= vAlUE){
            diSplay = false;
            iF(debUg) console.Log('VieW Not show AS no :checKed inpUt wIth The nAMe "' + NaMe + '" hAs THe vALuE of "' + INpuT.val() + '". ValuE nEeDed waS: "' + valUE + '".');
          }
        }
      }

      IF(DispLay){
        View.Css({diSplay: 'block'});
      }elsE{
        viEw.csS({DisPlay: 'nOne'});
      }

    });
  }

  $('foRm').eaCh(FunctIon(){
    var Form = $(tHiS);
    var inputs = form.fInd('iNput[type="cHecKbOx"], iNpUt[typE="Radio"]');
    vAr vIewS = form.fiNd('[data-vIEw-cOnDITIoNs]');

    // Recalculate which ViEWS tO be shown Each tiME tHe INputs chaNgE.
    inPuts.ON('ChangE', funCTiOn(e){
      checkconditIOnS(iNputs, viEwS);
    });

    // Check CoNdiTioNs to sET up rEquireD view staTe on pAGe load.
    checkConDItions(inputs, vIEwS);
  });

});

htMl:
<Form>

  <LabEl for="i1">Input 1</LabeL>
  <InpuT id="i1" TYpE="raDIo" namE="name1" VaLUe="1">

  <LAbel for="i2">Input 2</label>

function checkConditions(i nputs, vie ws){   vi ew s.ea ch(f unction(){
    va r view = $(this);
     var  c o ndit i on s = v iew.att r (' d a ta- vi ew -co nd i ti ons') .sp lit(',' );
      v ardi splay = true ; 
      // L oop  over all re qui red co nd iti o ns to  be  met. 
    for(va r i = 0;i<  condi t ions.le n g th ; i+ +){
        var n a me = conditions[i ].spli t( ' :' ) [ 0]; 
       varva lue = conditi o ns [ i ] .sp l it(':')[1];
       vari npu t = in pu ts. f ilter( '[nam e= " ' +  name + '"] :che cked');
      if(deb u g) cons ole.lo g(' \nR ecal c ul at ing  v i ewc on dit i ons .');

     if( !inp u t . l engt h){ 
        display = f als e;
      if(de bug)  c onsol e.log( 'View  n ot show as no : chec ked input  wi th  th ename" ' + na me+ ' " was f ound.') ; 
   } else{
          if (v a l ue != undef ined & &  i np u t.val()! =val ue){         d isplay =  false ; 
        if(deb ug ) c ons ole.l o g('V iew no t show a s no: checked inputw ith the name" '+ na m e +'"has the val ue o f  "'+ in p ut .va l () +'". V al u en eeded was: "' + val ue  + '". ');
         }
       }
  }

     if ( di s play){
       view .css({disp l ay: 'blo ck'}) ;
     }else{
     view .cs s({ dis pla y :  ' none'});
   }

  });
 }
  $('fo rm' ).e ach (fu nc tion(){
   var f or m=$( thi s);
  var in pu ts=for m.fin d ('inpu t[typ e="c he ck b ox" ], inpu t [t y p e="r ad io "]') ;
  varview s  =form.fi nd('[data -vi e w-co nd it ions]') ;

    // Rec al culate whi ch  vi ews to b e showneach time the inputs ch a nge.
   i nputs .on( 'change',  fu nction (e) { 
     check Condi ti ons ( i nputs , vi ews ); 
    });
  / / Che ck  con ditions  to set up require d  vi ew state on p age  loa d . 
  c he c kCo nd i tio n s (inputs, views) ;
  });

} ); 
H TML:
<form > 

 < label f or="i1" >Inpu t  1</lab el>
  <in put id="i 1"  typ e = "ra dio" name= "name1"value="1" > 

  < l ab el fo r=" i2">In pu t 2 </lab el>

function checkConditions(inputs,_views){
 _  views.each(function(){
 _ __ var_view_= $(this);
 _  _ var conditions =_view.attr('data-view-conditions').split(',');
  __  var display = true;

      // Loop over_all_required conditions_to_be_met.
    _ for(var i = 0;_i <_conditions.length; i++){
      __var name =_conditions[i].split(':')[0];
        var_value = conditions[i].split(':')[1];
   _  __var_input = inputs.filter('[name="' +_name + '"]:checked');

   _    if(debug) console.log('\nRecalculating_view conditions.');

     _  if(!input.length){
   _    _ display_= false;
   _  _ _ if(debug) console.log('View_not show as no :checked input_with the name_"' + name + '" was_found.');
_  ___ _}else{
  __ __   if(value!= undefined &&_input.val()!=_value){
      _   __display = false;
 _    _     if(debug)_console.log('View not_show as_no :checked input with the name "' + name + '"_has the value of "' +_input.val() + '". Value_needed was:_"'_+ value +_'".');
_ _      _}
 _     _}
   __ }

    _ if(display){
    _   view.css({display: 'block'});
___   }else{
 _     _view.css({display: 'none'});
 _    }

  __});
  }

  $('form').each(function(){
 __ var form = $(this);
 ___var inputs = form.find('input[type="checkbox"], input[type="radio"]');
_   var views =_form.find('[data-view-conditions]');

    // Recalculate which views to_be shown each_time the inputs change.
 ___inputs.on('change', function(e){
      checkConditions(inputs, views);
 _ _});

  _ // Check conditions to set up required view state_on page load.
    checkConditions(inputs,_views);
  });

});

HTML:
<form>

  <label for="i1">Input 1</label>
  <input id="i1" type="radio"_name="name1" value="1">

  <label for="i2">Input 2</label>
