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

How to Show/hide value using checkbox and roll templates?

1534838845
Sad
Sheet Author
API Scripter
                                    <div class="myrow grtopbrd"> <input class="pseudocheck" type="checkbox" name="attr_atk_bonus_used" value="1" title="@{repeating_attacks_$id_atk_bonus_used}" checked="checked" /> <span></span> <span class="lbl atk">bonus used:</span> <input type="text" name="attr_atk_bonus_used_amount" class="underlined " style="width:60px" spellcheck="false" placeholder="0" /> </div> {{#rollGreater() atk_bonus_used 0}} <div class="myrow"> <span class="lbl bold">bonus</span> <span class="notes inl">{{atk_bonus_used_amount}}</span> </div> {{/rollGreater() atk_bonus_used 0}} I have above code. but  atk_bonus_used_amount       do not show,when i checked the checkbox.
1534856124
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What does your roll button value look like?
1534861828
Sad
Sheet Author
API Scripter
<button class="myrol" style="width: 100%;" type="roll" name="roll_attack" title="Attack & Damage roll" value="@{whispertype} &{template:pc} {{name=@{atkname}}} {{charname=@{character_name}}} {{roll=[[(@{atk_DP_sum}+@{atk_reduce})d10>8!@{atk_again}]]}}{{notes=@{atk_notes}}}{{atk_bonus_used=@{atk_bonus_used}}}{{atk_bonus_used_amount=@{atk_bonus_used_amount}}}">
1534871630
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, so, in order to use the #rollgreater helper functions (or any of the roll... helpers), there has to be a roll in that field. Change the field in the roll to: {{atk_bonus_used=[[@{atk_bonus_usedd1]]}}}
1534907534
Sad
Sheet Author
API Scripter
That's work. Thankyou very much!