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

Display a Roll Button when Checkbox is selected

1596936191

Edited 1596941948
Ray
Pro
Greetings I hope the above title is self explanatory...when I check the checkbox the Roll Button does not appear...I cannot see the error... Here is my HTML...         <div>             <input class="field40 center" type="checkbox" class="sheet-block-switch" name="attr_skacrobatics" value="1" unchecked>             <div class="sheet-block-a">                 <div class="field10"></div>                 <div class="field130 left">Acrobatics</div>                 <input class="field40 center" type="number" name="attr_skacrobaticsxp" value="0">                 <div class="field10"></div>                 <input class="field40 center" type="number" name="attr_skacrobaticsroll" value="" readonly>             </div>             <div class="sheet-block-b">                 <div class="field10"></div>                 <div class="field130 left">Acrobatics</div>                 <input class="field40 center" type="number" name="attr_skacrobaticsxp" value="0">                 <div class="field10"></div>                 <input class="field40 center" type="number" name="attr_skacrobaticsroll" value="" readonly>                 <button type="roll" name="roll_acrobatics" title='acrobatics' value="&{template:default}{{name=@{character_name} makes an Acrobatics skill roll}}{{needing [[round(@{pre}/5)+9]] or less}}{{and rolls [[3d6cs>7cf<0]]}}"></button>             </div>         </div> and here is my CSS... .sheet-block-a, .sheet-block-switch:checked ~ .sheet-block-b {   display: block; } .sheet-block-b, .sheet-block-switch:checked ~ .sheet-block-a {   display: none; }
1596937034
GiGs
Pro
Sheet Author
API Scripter
You have two class declarations in your checkbox. This <input class="field40 center" type="checkbox" class="sheet-block-switch" name="attr_skacrobatics" value="1" unchecked> should be  <input class="field40 center sheet-block-switch" type="checkbox" name="attr_skacrobatics" value="1" > When you have multiple classes, you separate them by spaces, as you have with field40 and center. You also dont need unchecked in there, since by default checkboxes are not checked.
Problem solved, as always, thanks again GiGs  :)
1596980216
GiGs
Pro
Sheet Author
API Scripter
You're welcome :)