I am trying to get a sheet worker to do multiplication inside a repeating field, and its not being nice. Can anyone explain what I am doing wrong? The formula is: numberleft * massleft = masstotalleft This is my html <fieldset class="repeating_othergear">
<div class='sheet-2colrow'>
<div class='sheet-col'>
<table class="sheet-skill" style="width:100%">
<tr>
<th>Gear</th>
<th><input type="text" class="sheet-input" name="attr_gear_name-left" /></th>
<th>Amount</th>
<th><input type="number" class="sheet-input" name="attr_numberleft" value="0" /></th>
<th>Mass ea.</th>
<th><input type="number" class="sheet-input" name="attr_massleft" value="0" /></th>
</tr>
<tr>
<td><input type="number" class="sheet-input" name="attr_masstotalleft" value="0" /></tr></td>
</tr>
<tr>
<td colspan="6"><textarea class="sheet-input" name="attr_gearnotes-left"></textarea></td>
</tr>
</table>
</div>
<div class='sheet-col'>
<table class="sheet-skill" style="width:100%">
<tr>
<th>Gear</th>
<th><input type="text" class="sheet-input" name="attr_gear_name-right" /></th>
<th>Amount</th>
<th><input type="number" class="sheet-input" name="attr_numberright" value="0" /></th>
<th>Mass ea.</th>
<th><input type="number" class="sheet-input" name="attr_massright" value="0"/></th>
</tr>
<tr>
<td><input type="number" class="sheet-input" name="attr_masstotalright" value="0" /></tr></td>
</tr>
<tr>
<td colspan="4"><textarea class="sheet-input" name="attr_gearnotes-right"></textarea></td>
</tr>
</table>
</div>
</div>
</fieldset>
And this is what I am working with in the sheet worker:
on("change:repeating_othergear:massleft change:repeating_othergear:numberleft sheet:opened", function() {
getAttrs([
"repeating_othergear_massleft", "repeating_othergear_numberleft"
], function(values) {
repeating_othergear_masstotalleft: values.repeating_othergear_massleft * values.repeating_othergear_numberleft
});
});
});
Thanks for your time.