
14/04/2010, 14:42
|
 | | | Fecha de Ingreso: noviembre-2002 Ubicación: Puebla, México
Mensajes: 474
Antigüedad: 22 años, 3 meses Puntos: 0 | |
Respuesta: Colorear fila seleccionada (checkbox)en una Tabla Salvo las compatibilidades por navegador:
function colorear(casilla, fila){
if(casilla.checked){
window.document.getElementById(fila).style.backgro undColor="#FEFA96";
}else{
window.document.getElementById(fila).style.backgro undColor="#FFFFFF";
}
}
function coloreaOn(fila, casillaId){
var selec = window.document.getElementById(casillaId);
if (selec.checked){
fila.style.backgroundColor = "#FEFA96";
}else{
fila.style.backgroundColor = "#FEFACD";
}
}
function coloreaOff(fila, casillaId){
var selec = window.document.getElementById(casillaId);
if(selec.checked){
fila.style.backgroundColor = "#FEFACD";
}else{
fila.style.backgroundColor = "#FFFFFF";
}
}
out.println("<tr bgcolor='#FFFFFF' onmouseover=\"JavaScript:coloreaOn(this,'selec"+mr ow+"') \" onMouseOut=\"JavaScript:coloreaOff(this,'selec"+mr ow+"')\" id='fila"+mrow+"'>");
out.println("<td class='divisor'><input type='checkbox' id='selec"+mrow+"' name='seleccion' value='"+curso.getCourseId()+"' onclick=\"JavaScript:colorear(this,'fila"+mrow+"') \"></td>"); |