Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> //<![CDATA[
function sumar(){
var total=0;
for (i=0;i<document.formulario.elements.length;i++){
if(document.formulario.elements[i].checked){
total+=parseInt(document.formulario.elements[i].value);
}
}
document.getElementById('total').innerHTML =total;
}
//]]>
<form name="formulario" action="#"> 1
<input type="checkbox" name="x" value="1" onclick="sumar()" />2
<input type="checkbox" name="x" value="2" onclick="sumar()" />3
<input type="checkbox" name="x" value="3" onclick="sumar()" />
Ahora solo te resta hacerlo con radiobuttons
Salu2