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] Display player written text as a button text.

Hello Team, I'm pretty new to this. I created a fieldset for an attack and I want players to give it a custom name. The name in question is also a roll button. I simply want the (Attack [checkbox]) to instead of "Attack" display whats in a "Weapon" field as a text. The [checkbox] hides everything that is underneath it. If it helps to explain here is the html <div class="sheet-repeated-entry" > <div class="sheet-inline"> <button class="sheet-roll sheet-undertext-button" type="roll" value="[rollformula]" name="roll_attack">Attack</button> </div> <input class="sheet-info-button" style="vertical-align: middle;" type="checkbox" name="attr_expand_attack"/> <div class="sheet-expand-info"> <div class="sheet-inline">     <div class="sheet-undertext">Weapon</div>     <input type="text" name="attr_attack_name" value="" style="width:90%"> </div> Thanks in advance!
1610792368
GiGs
Pro
Sheet Author
API Scripter
If the button to launch the attack is inside the repeating section, you can just include @{ attack_name} in the button value, to show the attack name. If you want to show it in the html somewhere, you can do  <span name="attr_attack_name"></span> The span will take the value of the input with the same name.
Absolutely amazing. Thank you so much!
1610809382
Andreas J.
Forum Champion
Sheet Author
Translator
I added an example of this to the wiki <a href="https://wiki.roll20.net/CSS_Wizardry#Button_Dynamic_Text" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Button_Dynamic_Text</a>