Live calculation with checkboxes

I have a free format checkbox question built using the CheckSelect function and table tool. I would like to have field dynamically calculate based on the check box selections

My HTML is below, but I'm unsure of how to approach the javascript needed to calculate the I3a_incentive variable (ultimately each item selected with have a different price and I need to display the sum of the prices for the selected items).

<table>

<tr>

<td>I would...</td>

<td></td>

</tr>

<tr class="clickable" oninput="calc()">

<td>[% ListLabel(I3List,1) %]</td>

<td class="input_cell">

[%CheckSelect(I3a_select, 1)%]

</td>

</tr>

<tr class="clickable" oninput="calc()">

<td>[% ListLabel(I3List,2) %]</td>

<td class="input_cell">

[%CheckSelect(I3a_select, 2)%]

</td>

</tr>

<tr class="clickable">

<td>[% ListLabel(I3List,3) %]</td>

<td class="input_cell">

[%CheckSelect(I3a_select, 3)%]

</td>

</tr>

<tr class="clickable">

<td>[% ListLabel(I3List,6) %]</td>

<td class="input_cell">

[%CheckSelect(I3a_select, 6)%]

</td>

</tr>

<tr>

<td>For an estimated summer bill credit of </td>

<td>$<span name="I3a_incentive" id="I3a_incentive"></span></td>

</tr>

</table>

8 replies