Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/01/2015, 02:10
Avatar de Carlos1975
Carlos1975
 
Fecha de Ingreso: mayo-2005
Mensajes: 29
Antigüedad: 19 años
Puntos: 0
Respuesta: Seleccionar todos los checkbox y dar color al tr

Gracias gracias

He modificado mis funciones y comprobado en varios navegadores y todo perfecto.

Dejo el resultado de las funciones modificadas por si valiesen a otros usuarios.

Código Javascript:
Ver original
  1. function SelectElements() {
  2.     var checkGroup = document.getElementsByTagName("input"),
  3.         total = checkGroup.length, i;
  4.      
  5.     for (i = 0; i < total; i++) {
  6.         if (checkGroup[i].name == "check[]") {
  7.             checkGroup[i].checked = 1;
  8.             checkGroup[i].parentNode.parentNode.style.background = "#ffc";
  9.             document.select_form.select_id.value = 0;
  10.         }
  11.     }
  12. }
  13.  
  14. function DeselectElements() {
  15.     var checkGroup = document.getElementsByTagName("input"),
  16.         total = checkGroup.length, i;
  17.      
  18.     for (i = 0; i < total; i++) {
  19.         if (checkGroup[i].name == "check[]") {
  20.             checkGroup[i].checked = 0;
  21.             checkGroup[i].parentNode.parentNode.style.background = "#fff";
  22.             document.select_form.select_id.value = 0;      
  23.         }
  24.     }
  25. }

Gracias de nuevo fiera

Última edición por Carlos1975; 13/01/2015 a las 09:34