Save this to a file and have a play. The total is updated whenever the selection in the drop downs change. The button is just used to display the current value of the hidden field.
Code:
<HTML>
<HEAD>
<script>
function Update_Total()
{
totalAmount.value = Number(ddCPU.value) + Number(ddHDD.value);
}
function Total_Click()
{
alert(totalAmount.value);
}
</script>
</HEAD>
<BODY onload="Update_Total()">
<SELECT id=ddCPU onchange="Update_Total()">
<OPTION value=200>Pentium II - £200</OPTION>
<OPTION value=300>Pentium III - £300</OPTION>
<OPTION value=400>AMD Athlon - £400</OPTION>
</SELECT>
<BR>
<BR>
<SELECT id=ddHDD onchange="Update_Total()">
<OPTION value=20>20Gb - £20</OPTION>
<OPTION value=30>40Gb - £30</OPTION>
<OPTION value=40>80Gb - £40</OPTION>
</SELECT>
<BR>
<BR>
<input type="button" value="Total" onclick="Total_Click()">
<INPUT id=totalAmount type="hidden" value=0>
</BODY>
</HTML>