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

Hide Repcontrol in Fieldset?

1576694828
Axel
Pro
Sheet Author
I would like to have a checkbox that toggles the repcontrol (the "add" and "modify" buttons) to be hidden when not checked and then displayed when checked. This will make it impossible to edit the fieldset, which is exactly what I want. The checkbox will essentially unlock the fieldset when checked. What would the code look like for something like that?
1576696498

Edited 1576696795
vÍnce
Pro
Sheet Author
place a checkbox input above the fieldset, then use css to show/hide .repcontrol example (you could use display:none  in the css if it didn't bother your layout) html <input class="sheet-repcontrol-toggle" type="checkbox" name="attr_toggle_repcontrol" value="1" checked=""> css to just hide repcontrol (preserves layout) input.sheet-repcontrol-toggle:not(:checked) ~ .repcontrol {   opacity: 0; } input.sheet-repcontrol-toggle:checked ~ .repcontrol {   opacity: 1; } css with display none input.sheet-repcontrol-toggle:not(:checked) ~ .repcontrol {     display: none; }
1576697522
Axel
Pro
Sheet Author
Cool! Thanks, this works perfectly! How exactly do I target a specific fieldset with this? Similar to changing the content of the repcontrol buttons?
1576698457

Edited 1576698582
Axel
Pro
Sheet Author
What I mean is, can I place the checkbox elsewhere and still target a specific fieldset? My problem is that the above method affects all fieldsets in the column I've built, so I need to be able to target a specific fieldset.
1576698777
Axel
Pro
Sheet Author
Nevermind, I solved it. Thanks!
1576699159

Edited 1576699208
vÍnce
Pro
Sheet Author
You can try using data-groupname of the repeating fieldset. ie.repcontrol[data-groupname="repeating_weapons"]
1576699177
vÍnce
Pro
Sheet Author
Axel said: Nevermind, I solved it. Thanks! Cool