Hello, I am editing a published doublecross 3rd sheet. ( <a href="https://github.com/Roll20/roll20-character-sheets/blob/master/DoubleCross3rd/DoubleCross3rd.html" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/blob/master/DoubleCross3rd/DoubleCross3rd.html</a> ) This function is applied to this sheet, and through the value of the checkbox, I want to use this data when the value is 0, and load other data when the value is 1. and I made checkbox like this <div class="sheet-reduction-section">
<div class="sheet-tit" data-i18n="i_reduction">침식치</div>
<div class="sheet-form">
<input type="text" name="attr_reduction" value="0" placeholder="0"/>
<span>/</span>
<input type="text" name="attr_reduction_max" value="300" class="sheet-max"/>
<input type="hidden" name="attr_hide_reduction" value="" />
</div>
<div>
<input type="hidden" name="attr_reduction_per" class="sheet-graph-per" value="" />
<div class="sheet-graph-box">
<div class="sheet-bar"><span></span></div>
</div>
</div>
<div class="sheet-ohter">
<strong data-i18n="i_reduction_03" style="background: #fff; color: #000">기원종</strong>
<input type="checkbox" name="attr_reduction_03" value="1"/>
</div>
<div class="sheet-ohter">
<strong data-i18n="i_add_dice">추가 주사위</strong>
<input type="number" name="attr_add_dice" value="0" placeholder="0"/>
</div>
<div class="sheet-ohter">
<strong data-i18n="i_add_effect_level">추가 레벨</strong>
<input type="number" name="attr_effect_level" value="0" placeholder="0"/>
</div>
</div> In this case, should we use the on change function to check the value of the checkbox? function getreduction_effect(type) {
var data = {0:0,1:0}; // 1 - add dice / 2 - add level
if(type >= 60) { // reduction more than 60
data[0] = 1;
}
if(type >= 80) { // reduction more than 80
data[0] = 2;
}
if(type >= 100) { // reduction more than 100
data[0] = 3;
data[1] = 1;
}
if(type >= 130) { // reduction more than 130
data[0] = 4;
}
if(type >= 160) { // reduction more than 160
data[1] = 2;
}
if(type >= 190) { // reduction more than 190
data[0] = 5;
}
if(type >= 220) { // reduction more than 220
data[1] = 3;
}
if(type >= 260) { // reduction more than 260
data[0] = 6;
}
if(type >= 300) { // reduction more than 300
data[0] = 7;
}
return data;
}