F.eks.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Vis sum af radios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
</style>
<script language="javascript" type="text/javascript">
function addForm(elm){
var sum = 0, f = elm.form;
var elms = f.getElementsByTagName("input");
for(i=0,im=elms.length;im>i;i++){
sum += elms[i].type == "radio" && elms[i].checked ? +elms[i].value : 0;
}
f.ialt.value = sum + ",00";
}
</script>
</head>
<body>
<form id="minForm" name="minForm">
Lastbil:
<input type="radio" name="lastbil" value="3000" onclick="addForm(this);">1: 3.000,-
<input type="radio" name="lastbil" value="4000" onclick="addForm(this);">2: 4.000,-
<input type="radio" name="lastbil" value="5000" onclick="addForm(this);">3: 5.000,-<br>
Dæktype:
<input type="radio" name="daektype" value="200" onclick="addForm(this);">1: 200,-
<input type="radio" name="daektype" value="500" onclick="addForm(this);">2: 500,-
<input type="radio" name="daektype" value="700" onclick="addForm(this);">3: 700,-<br>
Lad:
<input type="radio" name="lad" value="800" onclick="addForm(this);">1: 800,-
<input type="radio" name="lad" value="1500" onclick="addForm(this);">2: 1.500,-
<input type="radio" name="lad" value="1800" onclick="addForm(this);">3: 1.800,-<br>
Samlet pris: <input type="text" name="ialt" value="0"><br>
<input type="submit" value="Få tilbud">
</form>
</body>
</html>