tengo un problema sobre el script que me proporcionaste JavierB:
Código HTML:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function sumar(frm) {
ele=frm.elements;
total=0;
for(i=0;i<ele.length;i++)
if(ele[i].type=='checkbox')
total+=(ele[i].checked) ? Number(ele[i].value) : 0;
document.frm.total.value=total;
}
//-->
</script>
</head>
<body>
<form name="form">
<p>100
<input type="checkbox" name="checkbox" value="100" checked onclick="sumar(this.form)">
<br>
20
<input type="checkbox" name="checkbox" value="20" checked onclick="sumar(this.form)">
<br>
40
<input type="checkbox" name="checkbox" value="40" checked onclick="sumar(this.form)">
<br>
10
<input type="checkbox" name="checkbox" value="10" checked onclick="sumar(this.form)">
<br>
30
<input type="checkbox" name="checkbox" value="30" checked onclick="sumar(this.form)">
<br>
<input name="total" type="text" id="total" size="10">
</p>
</form>
</body>
</html>
tengo un cuadro de texto
Código HTML:
<input name="total" type="text" id="total" size="10">
en el cual quiero que se visualice el resultado de las sumas pero me sale un error :
que esta mal en ?>>
document.frm.total.value=total;
saluditos