for (var i=1;i<=20;i++){ if($('input:radio[name="r'+i+'"]:checked').val() == null){ return false; } }