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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Hiding text?

1469930756

Edited 1469930797
Hey guys! I'd like some help from the code guru's out there. I'm currently making a custom character sheet and would like to know if there is a way that I can hide a bunch of text, inputs, etc. Ideally, I want a checkbox with text next to it, that when pushed, reveals a bunch of text inputs. Here is the basic code that I want put on   <input type="checkbox" data-toggle="collapse" data-target="#demo">Backpack?</input>   <div id="demo" class="collapse">     <div class='sheet-3colrow'>     <div class='sheet-col'>         <h4>Amount</h4><input type="number" name="attr_EquipmentAmount1" value="0"/><br>         <input type="number" name="attr_EquipmentAmount2" value="0"/><br>         <input type="number" name="attr_EquipmentAmount3" value="0"/><br>         <input type="number" name="attr_EquipmentAmount4" value="0"/><br>         <input type="number" name="attr_EquipmentAmount5" value="0"/><br>     </div>     <div class='sheet-col'>         <h4>Item and effects/stats</h4><input type="text" name="attr_EquipmentStats1"/>         <input type="text" name="attr_EquipmentStats2"/>         <input type="text" name="attr_EquipmentStats3"/>         <input type="text" name="attr_EquipmentStats4"/>         <input type="text" name="attr_EquipmentStats5"/>     </div>     <div class='sheet-col'>         <h4>Weight</h4><input type="number" name="attr_EquipmentWeight1" value="0"/><br>         <input type="number" name="attr_EquipmentWeight2" value="0"/><br>         <input type="number" name="attr_EquipmentWeight3" value="0"/><br>         <input type="number" name="attr_EquipmentWeight4" value="0"/><br>         <input type="number" name="attr_EquipmentWeight5" value="0"/><br>     </div>    </div>   </div> Any ideas on how to make this work on the character sheet? Or if this itself doesn't work, something that works similar?
1469943686
vÍnce
Pro
Sheet Author
A few things.  All sheets share the same code so you can't use id's in the html on roll20.  All class names should include "sheet-..." in them.  You need to use css to hide/show an element.  Anything within the element (often a div and any child elements) will also be hidden.  Make sure to read the  Building Character Sheets section of the wiki and post any questions you might have. Cheers Try this; css .sheet-collapse-show:checked ~.sheet-collapse {     display: none; } html  <input type="checkbox" class="sheet-collapse-show" name="attr_collapse-show" value="1">Backpack?</input>   <div class="sheet-collapse">     <div class='sheet-3colrow'>     <div class='sheet-col'>         <h4>Amount</h4><input type="number" name="attr_EquipmentAmount1" value="0"/><br>         <input type="number" name="attr_EquipmentAmount2" value="0"/><br>         <input type="number" name="attr_EquipmentAmount3" value="0"/><br>         <input type="number" name="attr_EquipmentAmount4" value="0"/><br>         <input type="number" name="attr_EquipmentAmount5" value="0"/><br>     </div>     <div class='sheet-col'>         <h4>Item and effects/stats</h4><input type="text" name="attr_EquipmentStats1"/>         <input type="text" name="attr_EquipmentStats2"/>         <input type="text" name="attr_EquipmentStats3"/>         <input type="text" name="attr_EquipmentStats4"/>         <input type="text" name="attr_EquipmentStats5"/>     </div>     <div class='sheet-col'>         <h4>Weight</h4><input type="number" name="attr_EquipmentWeight1" value="0"/><br>         <input type="number" name="attr_EquipmentWeight2" value="0"/><br>         <input type="number" name="attr_EquipmentWeight3" value="0"/><br>         <input type="number" name="attr_EquipmentWeight4" value="0"/><br>         <input type="number" name="attr_EquipmentWeight5" value="0"/><br>     </div>    </div>   </div>
1470020627
Finderski
Plus
Sheet Author
Compendium Curator
Also check out the  CSS Wizardry post—start at page 1, there's some awesome stuff in there.
1470058253
Lithl
Pro
Sheet Author
API Scripter
Vince said: All class names should include "sheet-..." in them.   That's not strictly required in your HTML; any class appearing in your HTML without the sheet- prefix will have it automatically added. However, it is required in your CSS file, so it's recommended to have in your HTML just for ease of writing things the same in both.
1470078223
vÍnce
Pro
Sheet Author
Brian said: Vince said: All class names should include "sheet-..." in them.   That's not strictly required in your HTML; any class appearing in your HTML without the sheet- prefix will have it automatically added. However, it is required in your CSS file, so it's recommended to have in your HTML just for ease of writing things the same in both. True.  Just a good habit with the roll20 sheets I guess. ;-)