SELECT CHECKBOX BASED ON ANOTHER CHECKBOX

<input id="TOP LINING 1" class="sum" type="checkbox" name="addonsl[]" value="87.98"><?php echo $value11 ."<BR/>"?>TOP LINING 1<br/>

if ( $my_name == "TOP LINING 1" ) {
    echo '<div class="top_lining_1 box">You have selected <strong>'.$res['OMEX_NAME'].'</strong> so price is '.$res['OMEX_PRICE'].'</div><input class="top_lining_1" value="'.$res['OMEX_NAME'].'" type="checkbox" name="addons3[]" style="visibility: hidden">';
                        ;
}


$(document).ready(function(){
//$(':checkbox:checked').prop('checked',false);
    $('input[type="checkbox"]').click(function(){
        if($(this).attr("id")=="TOP LINING 1"){
            if (this.checked){
            $(".top_lining_1").show();
            $('.top_lining_1').prop('checked', true);
            }
            else{
            $(".top_lining_1").hide();
            $('.top_lining_1').prop('checked', false);
            }
           
        }
});
});

Comments

Popular posts from this blog

Script For Login, Logout and View Using PHP, MySQL and Bootstrap

Hyperledger Development with in 10 days — Day 6

Insert CheckBox and Radio button Data in MySQL Database Using PHP