I am new to this and just started playing with the custom character sheet editor a month ago. I am trying to update a field in a specific repeating section when either a text input or a checkbox input changes in that specific repeating section. I have narrowed the problem to the posted section because everything else works when I comment it out. These are the repeating row input elements. <fieldset class="repeating_meleeweapons"> <input Class="sheet-tiny" type="text" name="attr_mwreq_str" />
<input Class="sheet-short" type="checkbox" name="attr_mwadd_str" value="1" />
<input Class="sheet-tiny" type="text" name="attr_mwdamage" readonly/> strength is outside the repeating section. <label class='sheet-heavy'>Strength </label><input type="text" name='attr_strength' class='sheet-short'> This is the script that breaks.
on("change:repeating_meleeweapons:mwadd_str change:repeating_meleeweapons:mwreq_str", function() {
getAttrs(["strength","repeating_meleeweapons_mwadd_str","repeating_meleeweapons_mwreq_str"], function(values) {
let str = parseInt(values.strength)||0;
let min = parseInt(values.repeating_meleeweapons_mwreq_str)||0;
let sck = parseInt(values.repeating_meleeweapons_mwadd_str)||0;
if (min < str && sck = 1) {
bonus = str - min;
} else {
bonus = 0;
}
setAttrs({
"repeating_meleeweapons_mwdamage": bonus
});
});
});
Thanks