Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Checkbox won't uncheck?

Not sure what I'm doing wrong here... but when I check a box on my character sheet, it absolutely refuses to uncheck. I mean it does when I click it, but if I leave the sheet and come back it's always rechecked. I've tried multiple sheets and multiple checkboxes. What am I doing wrong?                     <div class="sheet-row sheet-skill-row">                         <div class="sheet-col-1-12"><button class="sheet-skill-roll" type="roll" name="roll_Acrobatics_Check" value="&{template:5eDefault} {{title=Acrobatics (AGI)}} {{subheader=@{character_name}}} {{subheaderright=Task Check}} {{rollname=Result}} {{threshold=[[@{acrobatics}+(?{Modifier|0})]]}} {{roll=[[{1d100cs<@{generalcritrange}cf>95}]]}}"></button></div>                         <div class="sheet-col-7-24 sheet-skill-name">Acrobatics (AGI)</div>                         <div class="sheet-col-1-6 sheet-skill-name">General</div>                         <div class="sheet-col-1-8"><input type="number" name="attr_acrobatics" value="0" step="1"/></div>                         <div class="sheet-col-1-8 sheet-offset-1-24 sheet-center"><input type="checkbox" name="attr_acrobatics_aptitude" value="0"></div>                     </div>
Nevermind I figured it out... Just in case anyone else runs into this issue, don't use a base value of 0 with checkboxes.
1444283850
Lithl
Pro
Sheet Author
API Scripter
Yes, checkboxes evaluate to 0 when unchecked and their value  value when checked. All inputs bound to an attribute will get their state set to whatever corresponds to the value of the attribute. Thus, an unchecked checkbox with value="0"  will get checked by the system when it sees the attribute's value matches the checkbox's value. When attempting to uncheck it, the system immediately re-checks it, since its value matches the "unchecked" value. In general, it is preferable to use value="1"  for checkbox inputs, as that lets you multiply by the checkbox's attribute in a calculation to determine it's on/off state. For example, "@{acrobatics} + 5 * @{acrobatics_aptitude}" would add 5 to acrobatics when you have the aptitude checkbox checked, and add nothing when not checked. Similarly, "@{acrobatics} - 3 * (1 - @{acrobatics_aptitude})" would subtract 3 from acrobatics when the aptitude checkbox is not  checked. Depending on the rules of game you're making a sheet for, there may be other useful values for a checkbox input, but 1 is the most common.
Thanks Brian! I always have this bad habit of thinking I've tried everything so I post a question only to solve it moments later myself >_>;