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

[Character Sheet Development] Dynamically change select element options

Hi all, This seems like much more of a general web development question, but given the sandbox I'm playing in, I haven't seen a solution to this yet that I think works in roll20. I am 99% sure that someone has already solved it here, but I haven't been able to find word of it. Anyway: I have a drop-down select element. As its selected value changes, I need a second drop-down select element's options to change dynamically (or just hide inapplicable ones) and by default select the first of those options. I know from searching that this is probably a two-step process (the altering of the DOM or fiddling with the CSS and then the changing of the actual attribute the second select represents); the second step I'm fine with, the first has me out of my depth. Any help is appreciated, and thanks!
I know you cannot do anything with the DOM in Roll20. You may want to review the CSS Wizardry page in the Wiki ( <a href="https://wiki.roll20.net/CSS_Wizardry" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry</a> ), specifically the section on Styling Select Dropdowns ( <a href="https://wiki.roll20.net/CSS_Wizardry#Styling_Select_Dropdowns" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Styling_Select_Dropdowns</a> ). As that uses pseudo-selectors and radio buttons to create things that look like dropdowns, you might be able to use that to achieve the effect.