function validarradios() {
var tab1 = $("#parte2").val(); --> vale 6 <br>
var list = new Array();
for (var x = 0; x < tab1; x++) {
var lsGrupo = "grupo3_" + x;
var objGrupo = document.getElementsByName(lsGrupo);
for (var i = 0; i < objGrupo.length; i++) {
if (objGrupo[i].checked) {
if (i == 0) {
list.push("Bueno");
}
if (i == 1) {
list.push("Malo");
}
if (i == 2) {
list.push("No Aplica");
}
}
}
}
alert(list);
}
I do not know why when (x) is 6, the cycle is exited and the last position is not validated and I even put for (var x = 0; x <= tab1; x++)
and nothing ... thanks in advance.
What happens is that the table that I have dynamics when he traveled to find the group of radios x and found a header where there was no group of radios only the initial question to answer others the cycle at the end did not validate the group of radios since it did not exist and increased the index at the end, what I did was create another validation in razor code to not increase the index when I found a header.