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 .
×
🍵 What is a cleric’s favorite hot drink? Divini-tea. 🍵
Create a free account

Hide repeating section

I'm a little lost in hiding elements from a repeating section, i tried to follow the CSS Wizardry but dind't work. How can I do in the best way possible? My HTML <div class='sheet-config'> <div class="2colrow"> <div class="col"> <fieldset class="repeating_jutsus"> <label>Nome</label><input type="text" name='attr_njutsu'><br /> <label>Custo</label><input type="number" name='attr_custo'><br /> <label>Dano</label><input type="number" name='attr_dano'><br /> <label>Alcance</label><input type="text" name='attr_alcance'><br /> <label>Alvo/Área</label><input type="text" name='attr_alvo'><br /> <label>Duração</label><input type="text" name='attr_duracao'><br /> <label>Descrição</label><textarea style="resize:none" name='attr_desc_jutsu'></textarea> <button type='roll' name='roll_AtaqueD' value='&{template:default} {{name=@{njutsu}}}{{@{desc_jutsu}}}'></button> <br /> <hr> </fieldset> </div> </div> CSS .charsheet { background-color: #ddd; min-width: 800px; } .charsheet label { display: inline-block; width: 75px; text-align: right; } .charsheet input { display: inline-block; width: 165px; } .charsheet input.sheet-short { width: 3.5em; } .charsheet table td, .charsheet table th { font-size: 1.2em; font-weight: bold; text-align: center; } select.sheet-dtype { width: 60px; vertical-align: top; } textarea { resize: vertical; overflow: auto; } /* div { display: flex; } */ .sheet-personagem, .sheet-config, .sheet-pericias { display: none; } /* show the selected tab */ .sheet-tabstoggle[value="personagem"] ~ div.sheet-personagem, .sheet-tabstoggle[value="configuration"] ~ div.sheet-config, .sheet-tabstoggle[value="pericias"] ~ div.sheet-pericias { display: block; } div.sheet-vantagens .repcontainer label{ width: 45px; } h4{ display:inline; } hr{ border-top: 1px solid black; } I just want to put the Name ('Nome') and a checkbox in the right to hide the rest of the fields.
My code was wrong, here is the new one <div class='sheet-config'> <div class="2colrow"> <div class="col"> <input type="checkbox" class="arrow" /> <fieldset class="repeating_jutsus"> <label>Nome</label><input type="text" name='attr_njutsu'><br /> <div class="body"> <label>Custo</label><input type="number" name='attr_custo'><br /> <label>Dano</label><input type="number" name='attr_dano'><br /> <label>Alcance</label><input type="text" name='attr_alcance'><br /> <label>Alvo/Área</label><input type="text" name='attr_alvo'><br /> <label>Duração</label><input type="text" name='attr_duracao'><br /> <label>Descrição</label><textarea style="resize:none" name='attr_desc_jutsu'></textarea> <button type='roll' name='roll_AtaqueD' value='&{template:default} {{name=@{njutsu}}}{{@{desc_jutsu}}}'></button> </div> <br /> <hr> </fieldset> </div> .charsheet { background-color: #ddd; min-width: 800px; } .charsheet label { display: inline-block; width: 75px; text-align: right; } .charsheet input { display: inline-block; width: 165px; } .charsheet input.sheet-short { width: 3.5em; } .charsheet table td, .charsheet table th { font-size: 1.2em; font-weight: bold; text-align: center; } select.sheet-dtype { width: 60px; vertical-align: top; } textarea { resize: vertical; overflow: auto; } /* div { display: flex; } */ .sheet-personagem, .sheet-config, .sheet-pericias { display: none; } /* show the selected tab */ .sheet-tabstoggle[value="personagem"] ~ div.sheet-personagem, .sheet-tabstoggle[value="configuration"] ~ div.sheet-config, .sheet-tabstoggle[value="pericias"] ~ div.sheet-pericias { display: block; } div.sheet-vantagens .repcontainer label{ width: 45px; } h4{ display:inline; } hr{ border-top: 1px solid black; } input.arrow { float: left; } input.arrow:checked ~ div.body { display: none; }
1581304684

Edited 1581304844
GiGs
Pro
Sheet Author
API Scripter
In the CSS, you have to precede each class name with sheet- so the arrow sections should be input.sheet-arrow { float: left; } input.sheet-arrow:checked ~ div.sheet-body { display: none; } i wouldnd use float there. I'd switch it to  display:inline-block,  or use a grid or flex flayout. And maybe you want to reverse those, so when checked it's displayed, and when unchecked it's hidden? For the html, you want your checkbox inside the fieldset but outside the div. Something like this <fieldset class="repeating_jutsus"> <label>Nome</label><input type="text" name='attr_njutsu' value="">         <input type="checkbox" class="arrow" name="attr_arrow" value="1" /> <br /> Always give your inputs a name. Value is optional, but it's usually a good idea.
Wow! That worked, I didn't know that I have to put the sheet-. Thanks a lot!
1581365619
Andreas J.
Forum Champion
Sheet Author
Translator
Dungeon said: Wow! That worked, I didn't know that I have to put the sheet-. Thanks a lot! It's number 2 on the Common mistakes list, we've all been there. <a href="https://wiki.roll20.net/Building_Character_Sheets#Common_Mistakes" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#Common_Mistakes</a>