I have a form as below, I want to dynamically update the value of the text field "totalcost" depending on the number of checkboxes ticked by the user.

1 checkbox ==> totalcost = 48
2 checkboxes ==> totalcost = 79
3 checkboxes ==> totalcost = 115

Note there is a forth checkbox to indicate the acceptance of the terms and conditions, I don't want the checking of this checkbox to influence the count.

Code:
<form name="form1" id="form1" action="payment.asp" method="POST">
<input name="checkbox1" type="checkbox" id="checkbox1" value="Item 1" />
<input name="checkbox2" type="checkbox" id="checkbox2" value="Item 2" />
<input name="checkbox3" type="checkbox" id="checkbox3" value="Item 3" />

<input type="text" name="totalcost" value="" />

<input name="terms" type="checkbox" id="terms" value="accept" />

<input type="submit" name="Submit" value="Submit" />
</form>
Any ideas?