Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/07/2011, 17:05
Avatar de totti026
totti026
 
Fecha de Ingreso: junio-2011
Mensajes: 150
Antigüedad: 12 años, 11 meses
Puntos: 4
Pregunta error de sintaxis

Hola que tal. tengo este script pero no me corre por sintaxis
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. var total = document.getElementById("total").value;
  3. function comprobarChecks()
  4. {
  5. var checks = document.getElementsByTagName("input"); //recojo todos los input
  6. for(i=0;i<checks.length;i++)
  7. {
  8. if(checks[i].type=="checkbox") //solo contemplo los de tipo checkbox
  9. {
  10. if(checks[i].checked) //si esta checkado agrego a total su valor
  11. sumar(checks([i].value);
  12. }
  13. else
  14. restar(checks[i].value);
  15. }
  16. }
  17. function sumar(valor)
  18. {
  19. total += valor;
  20. document.formulario.total.value=total;
  21. }
  22. function restar(valor)
  23. {
  24. total-=valor;
  25. document.formulario.total.value=total;
  26. }
  27. </script>

Al parecer el error esta en la linea 11
Alguna idea? se los agradeceria mucho!