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 .
×
Advertisement Create a free account

The Lack of Dom access...

1626745068

Edited 1626745151
What I would like to do: Based on the value of an input-checkbox (an attr) I want to hide or make visible a input-text field (also an attr). --- This is easy if i have access to javascript & DOM(Which we don't) --- its easy in css to style a field based on some element value .class[value="xyz"] {}      (but this wont work as i want to change field b's css "display:block/none" attribute based on field a's value (a checkbox) ) What is the simplest way of doing this on a sheet? Thanks !    
1626747154

Edited 1626747221
Kraynic
Pro
Sheet Author
You can use the css method.&nbsp; Unless I am misunderstanding what you want to do. <a href="https://wiki.roll20.net/CSS_Wizardry#Show.2FHide_Areas" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Show.2FHide_Areas</a>
1626747621

Edited 1626747743
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, just need some CSS selectors, and depending on how your html is structured, you may need a type='hidden' duplicate of the checkbox. .control[value="xyz"] ~ .target{ &nbsp;&nbsp;&nbsp;&nbsp; display:none; } I'll also note that if you're going to be using the [value="xyz"] syntax, you will have to use a hidden duplicate as type='hidden' inputs are the only inputs whose value property changes to match the value stored in firebase; all the others keep the same value property (their default value) regardless of what the attribute's actual state is.
1626754025
Oosh
Sheet Author
Scott C. said: type='hidden' inputs are the only inputs whose value property changes This tripped me up when I started my first sheet a week or so ago, and I had to figure it out myself all over again. That'll teach me to RtFWiki! Actually, it won't. I still skim, then get mad when I miss important bits :(