I am trying to have a simple addition calculation when an input is keyup'ed. Here is my html:
<tr id="a">
<td>
<label>A</label>
</td>
<td>
<label>Results/Action Orientation (asset)</label>
</td>
<td class="shade">
<input id="a_per" type="text" />
</td>
<td class="shade">
<input id="a_pot" type="text" />
</td>
<td class="shade">
<input id="a_tot" class="totals" type="text" disabled="disabled" />
</td>
</tr>
And here is my jQuery for the keyup event:
$('#a_per').keyup(function() {
if($('#a_pot').value != "") {
var tot = this.value + $('#a_pot').value;
$('#a_tot').value = tot;
}
});
I am going to tailor it to fire when either #a_per or #a_pot keyup but first I want to make sure this will work.
Any help is appreciated. Thanks.