Código PHP:
<html>
<head> <script language="JavaScript">
function sum(){
var a = 0;
var b = Number(document.frm.text1.value);
a = b *0.2;
if (document.frm.chk1.checked){
a = a + 10;
}
if (document.frm.chk2.checked){
a = a + 20;
}
}
</script> </head>
<body>
<form name="frm">
<input type="text" name="text1" size=10>
<input type="checkbox" name="chk1">Selector<br>
<input type="checkbox" name="chk2">Selector<br>
<input type="text" name="text2" size=10>
<input type="button" value="total" onClick="document.frm.text2.value = a">
</form>
</body>
</html>