Checking for radio button value, still not working as expected

Checking for radio button value, still not working as expected

Hi everyone,

I'm checking for a radio button's value and hiding/showing a node based on that value, but it's not working right. Two radio buttons: one's value is yes, the other no. If you click on yes, the div shows up. When you click no, it hides, so that works.

But I have a list of checkboxes that also may or may not show that element based on the radio button selection, and it's this part that isn't working.

  1. $('[name="'+obj.name+'"]:checkbox').click(function () {
                    aThroughS = ($('[name="'+obj.name+'"]:checkbox:lt(19):checked').length > 0),
                    tSelected = ($('[name="'+obj.name+'"]:checkbox:eq(19):checked').length > 0),
                    rSelected = ($('[name="'+obj.name+'"]:checkbox:eq(17):checked').length > 0),
                    sSelected = ($('[name="'+obj.name+'"]:checkbox:eq(18):checked').length > 0),
                    rAndS = ((rSelected || sSelected)),    aThroughST = ((aThroughS && tSelected));
                    //console.log("aThroughS: "+aThroughS+", tSelected: "+tSelected+", rAndS: "+rAndS+", aThroughST: "+aThroughST);
                    if ($('[name="'+obj.name+'"]:checkbox:checked').length == 0) { $(obj.eid).each(function () { $('#'+this).hide(); }); }
                    else {
                        if (aThroughS) {
                            $('#'+this).show();
                            if ($('[name="+obj.name+"]').attr('value') == 'yes')
                            {
                                $(obj.value).show();
                            }
                            else $(obj.value).hide();
                        }
                        else $(obj.value).hide();
















Thanks,

Eugene "Eggers"