Scott C. said: Ok, you've got a few issues in that code snippet: Thanks for your help Scott C, I finally got it working using your method, but there are some very huge gotchas that I had a very difficult time figuring out! I am just going to mention them here, to help anybody having the exact same problems. You are correct that having a checkbox with a value of "0" is sometimes a problem (but in other places it seems to work fine, not sure what is up with that), but sometimes it does cause problems. You say that "Checkboxes with the same name, but different check values do not work well as the Roll20 implementation of them does not support it", but I learned the method from the CSS Wizardry thread here on Roll20, and have found the method to work very reliably here on roll20 for years. However I traced my original problems that I wrote about above to it affecting Select statements where there is a checkbox with the same name. I would have sworn that it was behaving better in years past. Maybe there was a change on the Roll20 side, I am not sure. Anyway, I do want to test for a value of zero, and was having the problems described above, so I was trying the method Scott C describes above. Like I said, there are some Gotchas. I tried the code snippets above, plus several variants, but they were not working. I found a stack overflow link <a href="https://stackoverflow.com/questions/10645552/is-it-possible-to-use-an-input-value-attribute-as-a-css-selector" rel="nofollow">https://stackoverflow.com/questions/10645552/is-it-possible-to-use-an-input-value-attribute-as-a-css-selector</a> where many people say that what was describe will not work, because it does not look to see if what the USER has entered matches the value, it simply checks to see if the value attribute hardcoded into the html matches. I tested it out and was convinced that the naysayers were correct, and what was described above could not work. However then I pasted one last snippets in exactly with no modifications whatsoever, and it worked. But while the test snippet worked, I could not get it to work in my code at all. I would paste a snippet into my sheets, and it would work, then I would add very similar code, using the exact same principles into my real code, and it would not work at all. started making new, slightly modified snippets, and changing one thing at a time, and finally found the first gotcha. But the 2nd gotcha took me forever to work out. There was code that seemed functionally identical, that obeyed all the common rules of css. And it would not work. It took me many, many hours to figure out the 2nd gotcha! So if anybody else is trying to make this work, here are the here are the gotchas! (1) If you are selecting from a select statement, the quote marks do not matter. .sheet-state1[value=None] and .sheet-state[value="None"] both work and are equivalent. All the examples you will find anywhere do not have quote marks, but having quote marks are OK. However if you are selecting from an input field type="number" then quotes are mandatory. . sheet-state1[value="0" ] will work. .sheet-state1[value=0 ] will not. This particular gotcha was easily suspected and easily found. (2) For some unknown weird reason, When you have a [value=nn] in your selectors, you can't use a comma to separate multiple selectors. Each selector needs its own declaration box! so .sheet-show-most:checked~.sheet-sect .sheet-testZero[value="0"]+.sheet-HideIfZero { display: none; }
.sheet-show-most:checked~.sheet-sect .sheet-testZero[value="1"]+.sheet-HideIfOne { display: none; } both work fine, but .sheet-show-most:checked~.sheet-sect .sheet-testZero[value="0"]+.sheet-HideIfZero, .sheet-show-most:checked~.sheet-sect .sheet-testZero[value="1"]+.sheet-HideIfOne { display: none;} Does not work at all for ether selector! I don't know what is up with that, and can only think that it must be some weird bug, but it was very, very hard to discover this since I tend to add selectors into comma separated lists, and as soon as I did, they stopped working. Very, Very Annoying! EDIT: As explained about 6 posts down, (2) as described above is not the whole answer. The problem is that if you have a bad selector in the list, it will not just ignore that selector, it might ignore the entire list. Thus you can't just add potential selectors to a list as it might cause the entire list to be disabled! Anyway, if you can avoid the weird things that don't work as you would expect them to, this works nicely and is well behaved. Thanks.