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

Hiding within a repeat possible?

1468444954

Edited 1468468021
I'm trying to make it so if the user wants they can "hide"a item in a repeat and just show the name... however it doesn't seem to work at all. I've used hide elsewhere for entire "repeat" sections but I can't seem to get it to work within a repeat. Here is what I've tried so far. Very simple note fields. <div class="sheet-tab-content sheet-tab7"> <br /> <strong>Notes</strong> <fieldset class="repeating_notes"> <table class="enclose" border="5" width="100%"> <tr class="enclose" align="center"><td class="enclose"> <input type="checkbox" name="attr_notes_hidewindow" class="hideoption" /><input type="text"  value="New Note" name="attr_notes_name" style="width: 200px"  /></td></tr> <div class="hidebody"> <tr> <td class="enclose"> <table class="repeat-table-style" width="100%"> <tr bgcolor="orange">     <td  class="repeat-tds">     <textarea name="attr_notes_text"></textarea>     </td> </tr> </table> </td> </tr> </div> </table> </fieldset>  </div> ----------CSS------ input.sheet-hideoption {     float: left; } input.sheet-hideoption:checked ~ div.sheet-hidebody {     display: none; } Any thoughts on where I went wrong?
1468469347

Edited 1468469449
Lithl
Pro
Sheet Author
API Scripter
Two things: You have a table row inside a div. This is invalid syntax, and so you have undefined behavior. The A ~ B selects for B that is a sibling of A (but does not necessarily follow immediately after, as is the case with A + B). The code you've posted has sheet-hideoption and sheet-hidebody as cousins, not siblings.
1468499012
Havoc
Sheet Author
API Scripter
I have something like this. Just have the input text outside the table that you want to hide. <h1>Henchmen</h1> <fieldset name="attr_repeating_henchmen" class="repeating_Henchmen"  style="width:100%;"> <div> <div class="sheet-col"> <h3>Name</h3>             <input type="text" name="attr_HenchName" style=" text-align:center; font-weight:bold; font-size:18px;" /> </div> <input type="checkbox" class="sheet-arrow" name="attr_HenchHide" checked/><span></span> <div class="sheet-body"> <table border="0" style="text-align: center"> *data* </table> </div> </div> <hr> </fieldset>
Thanks for the tips. this <div> stuff is fairly new to me. I've only ever used tables/etc. I got it working tho I am having issues aligning the way I want. Farking checkbox is always far left when I say align center... so I'll poke around and see if I can't figure out why.
1468551842

Edited 1468551924
This is what I ended up with that seems to work as I wanted (checkbox to left of the input name box) and hides the body of the note if they tick it. Again thanks for the help! <fieldset class="repeating_notes" style="width:100%;" align="center" > <div class='sheet-col' style="width:100%; background:orange; text-align:center; color:white;"> <input type="checkbox" name="attr_notes_hidewindow" class="hideoption" style="vertical-align:middle; text-align:center; float:none; " /><input type="text"  value="New Note" name="attr_notes_name" style="width: 200px"  /> <div class="hidebody"style="width:100%;"> <table class="repeat-table-style" width="100%"> <tr bgcolor="black">     <td  class="repeat-tds"><textarea name="attr_notes_text"></textarea></td> </tr> </table> </div> </div> <div class='sheet-col' align="center" style="width:100%; background:black; height:15px;"> </div> </fieldset>
1468584501

Edited 1468584553
Lithl
Pro
Sheet Author
API Scripter
FWIW, text-align:center on a checkbox isn't going to ever accomplish anything. text-align determines how text within  the element is aligned, and checkboxes don't contain text. Also, I'm fairly positive that style  and align  on your fieldset will not be carried over to the rendered character sheet. The align  attribute is deprecated, anyway. (The same is true of the bgcolor  attribute you're using.) Also also, without extensive CSS of your own modifying the appearance of the repitem and repcontainer classes, sheet-col isn't accomplishing anything particularly useful for you in the above HTML code. Also also also, a table with a single cell isn't really much of a table. You'd get the same presentation from just about any block container, like a div. Hell, you don't even need that; your textarea could be the sole child of your sheet-hidebody div.
Yeah a lot of that input for checkbox was me experimenting trying to figure out how to get the bloody check in the right spot. I ended up leaving what I had there once I got it sorted... some as you pointed out not needed. I think the sheet-col biz I just copy/pasted from an example in another post somewhere. I'll keep that tidbit in mind. Thanks for the follow up information.