Return to Snippet

Revision: 34199
at November 8, 2010 06:46 by Meander365


Updated Code
var radio_groups = {}
$(":radio").each(function(){
    radio_groups[this.name] = true;
})


for(group in radio_groups){                    
    if ($(:radio[name="+group+"]:checked).length ==0) {
    //not checked
    } else {
    //checked
    }
        
}

Revision: 34198
at October 19, 2010 07:05 by Meander365


Initial Code
var radio_groups = {}
$(":radio").each(function(){
    radio_groups[this.name] = true;
})


for(group in radio_groups){                    
    if ($(:radio[name="+group+"]:checked").length ==0) {
    //not checked
    } else {
    //checked
    }
        
}

Initial URL
http://stackoverflow.com/questions/1165627/jquery-and-radio-button-groups

Initial Description


Initial Title
jQuery Determine if at least one radio button is checked in a radio group

Initial Tags
javascript, jquery

Initial Language
jQuery