calulating javascript event on keyup
<p>the following works in Jfiddle-but when i use it in original form, the total_full and total_half fields are calculated automatically from other fields, and therefore do not have a keyup or keydown event? therefore the "sub_total" field is not calculating when the "total_full" and total_half fields are updated?</p>

<p>HTML</p>

<pre><code>&lt;td&gt;Total Cost Full Day&lt;/td&gt;
&lt;input type="text" name="total_full" id="total_full"  /&gt;

&lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;

 &lt;td&gt;Total Cost Half Day&lt;/td&gt;
&lt;input type="text" name="total_half" id="total_half"  /&gt;

&lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
</code></pre>

<p>JAVASCRIPT</p>

<pre><code>//Calculate Sub Total


function calculateSubTotal() {

    var SubTotal = +document.getElementById("total_full").value + +document.getElementById("total_half").value + +document.getElementById("add_on").value;

    document.getElementById("sub_total").value = isNaN(SubTotal) ? 0 : SubTotal;
}


document.getElementById("add_on").onchange = calculateSubTotal;
document.getElementById("add_on").onkeyup = calculateSubTotal;
document.getElementById("total_full").onchange = calculateSubTotal;
document.getElementById("total_full").onkeyup = calculateSubTotal;
document.getElementById("total_half").onchange = calculateSubTotal;
document.getElementById("total_half").onkeyup = calculateSubTotal;
calculateSubTotal;
document.getElementById("total_half").onchange = calculateSubTotal;
document.getElementById("total_half").onkeyup = calculateSubTotal;
</code></pre>

<p>​</p>

<p><a href="http://jsfiddle.net/newbie123/ue62p/5/" rel="nofollow">http://jsfiddle.net/newbie123/ue62p/5/</a></p>
