ASP - Tabla de nota y no recorre

 
Vista:

Tabla de nota y no recorre

Publicado por alejandra (22 intervenciones) el 20/07/2010 23:32:13
Buenas tarde

Espero que me puedan ayudar tengo un tabla de datos en donde aparecen los datos del alumnos tengo un input en donde agrego la nota y una columna sitacion en donde aparece el Aprobado y Reprobados pero no lo hace y solo lo cambia en la primera posicion.
Nose que hacer he hecho de todo pero no funciona y lo unico que quiero la nota que escriba me aparezca un mensaje indicando estado,. Gracias y ayudenme gracias
alejandra
adjunto codigo
este el HTML mas abajo esta el js
<html>
<head>
<script type="text/javascript" src="jss.js"></script>


</head>
<body>
<form name="EvAlu">
<input type="texto" id="nota" value="4">
<input type="texto" id="asis" value="0">
<table width="96%" border="1" align="center" id="table">
<tr class="titulo_tabla">
<td width="2%">Nº</td>
<td width="15%">RUT</td>
<td width="*%">Nombre</td>
<td width="10%">Nota</td>
<td width="10%">Situación</td>
</tr>
<tr>
<td align="right">1</td>
<td align="right" >12811148-4</td>
<td> CRISTI MUÑOZ HELENE</td>
<td><input type="text" size="3" maxlength="3" name="N12811148" value="0" onBlur="rango(this)"></td>
<td>
<select name="nota12811148" id="no" >
<option selected value="1">Cursando</option>
<option value="2">Aprobado</option>
<option value="3">Reprobado</option>
<option value="7">Desertor</option>
<option value="8">Desertor Justificado</option>
</select>
</td>
</tr>
<tr>
<td align="right">2</td>
<td align="right" >13087423-1</td>
<td>PINO SALAZAR ANA LISSETTE</td>
<td><input type="text" size="3" maxlength="3" name="N13087423" value="0" onBlur="rango(this)" ></td>
<td>
<select name="nota13087423" id="no" >
<option selected value="1">Cursando</option>
<option value="2">Aprobado</option>
<option value="3">Reprobado</option>
<option value="7">Desertor</option>
<option value="8">Desertor Justificado</option>
</select>
</td>
</tr>
<tr>
<td align="right">3</td>
<td align="right" >3038395-8
</td>
<td>ABARCA ESCOBAR JUAN</td>
<td><input type="text" size="3" maxlength="3" name="N3038395" value="0" onBlur="rango(this)" ></td>
<td>
<select name="nota3038395" id="no" >
<option selected value="1">Cursando</option>
<option value="2">Aprobado</option>
<option value="3">Reprobado</option>
<option value="7">Desertor</option>
<option value="8">Desertor Justificado</option>
</select>
</td>
</tr>
<tr>
<td align="right">4</td>
<td align="right" >14132397-0</td>
<td>ABELLEIRA PERALTA MILLARAI</td>
<td><input type="text" size="3" maxlength="3" name="N14132397" value="0" onBlur="rango(this)" ></td>
<td>
<select name="nota14132397" id="no" >
<option selected value="1">Cursando</option>
<option value="2">Aprobado</option>
<option value="3">Reprobado</option>
<option value="7">Desertor</option>
<option value="8">Desertor Justificado</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>

js
function rango(id)
{
valor=parseInt(id.value,10);


notaini=window.document.EvAlu.nota.value


cantFilas = document.getElementById("table").rows.length;
for(i=0;i<cantFilas;i++)
{

var x=document.getElementById('table').rows[i].cells

if ((notaini<=valor))
{
id.style.background="cyan";
id.style.color="blue";
var o = document.createElement('input');
o.type = "text";
o.name = "lalala";
o.value = "Aprobados";
document.getElementById('no').appendChild(o);
document.getElementById('no').style.visibility = 'hidden';
// document.getElementById('no').selectedIndex[i] =1
// document.getElementById("no").length = 1;
//document.getElementById("no").options[0].value = "Aprobado";
//document.getElementById("no").options[0].text = "Aprobado";
return;
}
else
{
id.style.background="red";
id.style.color="blue";
document.getElementById('no').selectedIndex[i] =2
//document.getElementById("no").length = 1;
//document.getElementById("no").options[0].value = "Reprobado";
//document.getElementById("no").options[0].text = "Reprobado";
return;
}

}
id.style.background="white";
id.style.color="black";
return true;

}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder