Hola, ¿podría por favor ayudarme? tengo este problema, me explico, tengo dos columnas, Siempre y Con frecuencia, la columna Siempre (cada radio botton tiene un valor de 2 en esta columna, por lo tanto su valor total es 10)
la columna Con frecuencia (cada radio botton tiene un valor de 1.34 en esta columna, valor total es de 6.7)
quiero hacer lo siguiente, que cuando seleccione por ejemplo todos los de la columna 1 me marque los 10, pero que al marca un radio botton de la columna 2 (Con frecuencia) se disminuya el puntare de 10 a 8 y que en el campo de texto total 2 me muestre los 1.34 que es el valor de un radio botton de esa columna, espero me entiendan, por favor agradezco su ayuda, y si no entienden algo agradezco me pregunte.
Este es el codigo de lo que hice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Prueba</title>
<script language="javascript">
function Suma(isChecked, myValue)
{
tot = parseFloat(document.Prueba.total1.value);
myValue = parseFloat(myValue);
if (isChecked) document.Prueba.total1.value = tot + myValue;
else document.Prueba.total1.value = tot - myValue;
}
-->
</script>
<script language="javascript">
function Suma2(isChecked, myValue)
{
tot = parseFloat(document.Prueba.total2.value);
myValue = parseFloat(myValue);
if (isChecked) document.Prueba.total2.value = tot + myValue;
else document.Prueba.total2.value = tot - myValue;
}
-->
</script>
</head>
<body>
<form id="form1" name="Prueba" method="post" action="">
<table width="289" border="1">
<tr class="centrado">
<td width="144">Siempre</td>
<td width="129">Con frecuencia</td>
</tr>
<tr>
<td><input type="radio" name="c0" onClick="Suma(this.checked,this.value)" value="2.00" id="1a_0"/></td>
<td ><input type="radio" name="c0" onClick="Suma2(this.checked,this.value)" value="1.34" id="1a_1" /></td>
</tr>
<tr>
<td ><input type="radio" name="c1" onClick="Suma(this.checked,this.value)"value="2.00 " id="1a_5" /></td>
<td><input type="radio" name="c1" onClick="Suma2(this.checked,this.value)"value="1.3 4" id="1a_6" /></td>
</tr>
<tr>
<td><input type="radio" name="c2" onClick="Suma(this.checked,this.value)" id="1a_10" value="2.00" /></td>
<td><input type="radio" name="c2" onClick="Suma2(this.checked,this.value)" value="1.34" id="1a_11" /></td>
</tr>
<tr>
<td><input type="radio" name="c3"onClick="Suma(this.checked,this.value)" value="2.00"id="1a_15" /></td>
<td><input type="radio" name="c3"onClick="Suma2(this.checked,this.value)" value="1.34" id="1a_17" /></td>
</tr>
<tr>
<td><input type="radio" name="c4"onClick="Suma(this.checked,this.value)"va lue="2.00" id="1a_16" />
<td><input type="radio" name="c4" onClick="Suma2(this.checked,this.value)"value="1.3 4" id="1a_3" /></td>
</tr>
</table>
<p> </p>
<input type="text" name="total1" value="0" id="total1">
<input type="text" name="total2" value="0" />
</form>
</body>
</html>