![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/06/2003, 06:49
|
![Avatar de Bravenap](http://static.forosdelweb.com/customavatars/avatar27366_1.gif) | | | Fecha de Ingreso: noviembre-2002 Ubicación: Los Arroyos, El Escorial, Madrid
Mensajes: 2.084
Antigüedad: 22 años, 2 meses Puntos: 4 | |
Bueno, más o menos he conseguido algo. A ver qué os parece:
Código:
<html>
<head>
<script>
function marcar() {
obj=arguments[0];
for(i=1;i<arguments.length;i++)
{
marca=arguments[i].replace('fila','');
marca='c'+marca;
if (obj.checked){
document.getElementById(arguments[i]).style.backgroundColor='#6699FF';
document.getElementById(marca).checked=true;
}
else{
document.getElementById(arguments[i]).style.backgroundColor='#66CCFF';
document.getElementById(marca).checked=false;
document.getElementById('cTodos').checked=false;
}
}
}
</script>
</head>
<body>
<table>
<tr bgcolor="#66CCFF" id="fila1">
<td>Título 1</td>
<td>Remitente 1</td>
<td>
<input id="c1" type="checkbox" onClick="marcar(this,'fila1')">
</td>
</tr>
<tr bgcolor="#66CCFF" id="fila2">
<td>Título 2</td>
<td>Remitente 2</td>
<td>
<input id="c2" type="checkbox" onClick="marcar(this,'fila2')">
</td>
</tr>
<tr bgcolor="#66CCFF" id="fila3">
<td>Título 3</td>
<td>Remitente 3</td>
<td>
<input id="c3" type="checkbox" onClick="marcar(this,'fila3')">
</td>
</tr>
</table>
<input type="checkbox" onClick="marcar(this,'fila1','fila3')">
Marcar mensajes 1 y 3<br>
<input id="cTodos" name="checkbox" type="checkbox" onClick="marcar(this,'fila1','fila2','fila3')">
Marcar todos los mensajes
</body>
</html>
Por cierto, acabo de entender qué es eso de arguments. Lo veía en muchos sitios pero todavía no lo había pillado. Gracias JavierB.
Un saludo a todos.
__________________ ¡¡NO A LA GUERRA!!
Si ponemos a nuestros mensajes títulos adecuados, la gente se animará más a abrirlos y resultarán más útiles en las busquedas. ¡No a los ayuuudaaa, urgenteee y similares!
Última edición por Bravenap; 25/06/2003 a las 06:58 |