"Radio Val filter"
Bootstrap 4.1.1 Snippet by iammohitverma

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> </div> </div>
// choose-for radio required control $('#yourself-no').click(function() { $(".choose-one input[type=checkbox]").removeAttr("required"); $(".choose-one input[type=checkbox]").attr('checked', false); $(".current-brand input[type=radio]").attr('checked', false); $(".choose-for input[type=radio]").attr("required",""); $('input[name=mobilitysec]').attr('checked', false); $('input[name=leakingsec]').attr('checked', false); $('input[name=mobilitysec]').prop('checked', false); $('input[name=leakingsec]').prop('checked', false); mymobilityValue = ''; myleakingCondition = ''; }); $('#yourself-yes').click(function() { $(".choose-for input[type=radio]").removeAttr("required"); $(".choose-for input[type=radio]").attr('checked', false); $('input[name=mobilitysec]').attr('checked', false); $('input[name=leakingsec]').attr('checked', false); $('input[name=mobilitysec]').prop('checked', false); $('input[name=leakingsec]').prop('checked', false); mymobilityValue = ''; myleakingCondition = ''; }); //by mohit start here var mymobilityValue = ''; var myleakingCondition = ''; $('input[name=mobilitysec]').change(function(){ var mobilityValue = $( 'input[name=mobilitysec]:checked' ).val(); mymobilityValue = mobilityValue; }); $('input[name=leakingsec]').change(function(){ var leakingCondition = $( 'input[name=leakingsec]:checked' ).val(); myleakingCondition = leakingCondition; }); $('#mobility-section input, #leaking-condition input').on('click', function(){ setTimeout (function productFilter(){ /*for walk-independently*/ if((mymobilityValue == "walk-independently") && (myleakingCondition == "light")){ $( "#productTitle, #dryPants" ).css( "display", "block" ); $( "#superPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-independently") && (myleakingCondition == "moderate")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-independently") && (myleakingCondition == "heavy")){ $( "#productTitle, #maxPants" ).css( "display", "block" ); $( "#superPants, #dryPants" ).css( "display", "none" ); } /*for walk-with-walking-aid*/ if((mymobilityValue == "walk-with-walking-aid") && (myleakingCondition == "light")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-with-walking-aid") && (myleakingCondition == "moderate")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-with-walking-aid") && (myleakingCondition == "heavy")){ $( "#productTitle, #maxPants" ).css( "display", "block" ); $( "#superPants, #dryPants" ).css( "display", "none" ); } /*for walk-stand-sit-with-human-assistance*/ if((mymobilityValue == "walk-stand-sit-with-human-assistance") && (myleakingCondition == "light")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-stand-sit-with-human-assistance") && (myleakingCondition == "moderate")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "walk-stand-sit-with-human-assistance") && (myleakingCondition == "heavy")){ $( "#productTitle, #maxPants" ).css( "display", "block" ); $( "#superPants, #dryPants" ).css( "display", "none" ); } /*for bed-rest*/ if((mymobilityValue == "bed-rest") && (myleakingCondition == "light")){ $( "#productTitle, #dryPants" ).css( "display", "block" ); $( "#superPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "bed-rest") && (myleakingCondition == "moderate")){ $( "#productTitle, #superPants" ).css( "display", "block" ); $( "#dryPants, #maxPants" ).css( "display", "none" ); } if((mymobilityValue == "bed-rest") && (myleakingCondition == "heavy")){ $( "#productTitle, #maxPants" ).css( "display", "block" ); $( "#superPants, #dryPants" ).css( "display", "none" ); } }, 500); }); //by mohit end here /

Related: See More


Questions / Comments: