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

Conceal Checkboxes not Remembering State when Sheet Closes

As per the title. When I reopen a sheet, the checkboxes that hide parts of the sheet are not remembered, though other checkboxes are remembering what they should be. Here is some VERY simple toy code below to illustrate the process. CSS .charsheet input.sheet-arrow { opacity: 0; width: 14px; height: 10px; position: relative; top: -4px; left: -6px; margin: -14px; cursor: pointer; z-index: 1; } .charsheet input.sheet-arrow + span::before { margin-right: 4px; line-height: 14px; text-align: center; display: inline-block; vertical-align: middle; content: "▼"; width: 14px; height: 14px; font-size: 12px; float: left; } .charsheet input.sheet-arrow:checked + span::before { content: "►"; } .charsheet input.sheet-arrow:checked ~ .sheet-repmods{ display: none; } .sheet-repmods{ display: block; } HTML <input type='checkbox' class='sheet-arrow' name='tester' value='1'/><span></span>  <div class='sheet-repmods'>Hello</div> When you click the arrow, it will roll up and down, but when opening the sheet, it will always be rolled-down for some reason, even if you rolled it up when closed. Likewise, if I use something like checked='true' , it will always default to that state. Additionally adding a hidden field like  <input type="hidden" name="tester" value="0">  doesn't help either. Anyone have any ideas?
1614972758

Edited 1614972797
A gif you will have to open to see what is going on
OK, I'm an idiot. I need to make the name of the checkbox to start with attr_ Leaving up in case this helps someone, and as a monument to my stupidity.
1614977125
Andreas J.
Forum Champion
Sheet Author
Translator
Eric M. said: OK, I'm an idiot. I need to make the name of the checkbox to start with attr_ Leaving up in case this helps someone, and as a monument to my stupidity. Good call, leaving thread open and answering your own question likely will help others in the future. For context, this is Number 1 on our list here: <a href="https://wiki.roll20.net/Building_Character_Sheets#Common_Mistakes" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#Common_Mistakes</a>
1614977946
GiGs
Pro
Sheet Author
API Scripter
And it's in the common mistakes section because we've all done it at some point. There's no reason to be embarrassed.
Yep. I actually had some with attr and others without. I was glazing over that when I did the initial copy/paste to make the toy script. I made a second one with a section that was working and did a diff after changing the names of the variables, and it hit me like a truck :)&nbsp;