Hi I am creating a webpage that when a user clicks a textbox the number of checked ones appears in a read only text box I have got this to work. However, if 6 - 9 boxes are checked I want the word "bronze" to appear in another read only checkbox likewise if 10 - 12 are checked "silver" should appear in the same read only text box as bronze and if 13 - 15 boxes are checked "gold" appears in the read only checkbox a new function should be used.

Code So Far.

<script type="text/javascript">
t = 0;
function totals(thisCheckbox) {
if (thisCheckbox.checked)
t += parseFloat(thisCheckbox.value);
} else {
t -= parseFloat(thisCheckbox.value);
document.getElementById("total").value = t;

<FORM name="form1" id="form1">
<input type="checkbox" name="cbox" value="1" onclick="totals(this);">
(note: repeated 14 more times)

<input type="text" readonly="readonly" name ="total" id="total">
(where number of checkboxes checked is outputed)

<input type="text" readonly="readonly" name="award" id="award">
(where bronze, silver or gold is outputed depending on boxes checked)