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

Can div class="sheet-undertext" print variables?

1581519621

Edited 1581519695
GiGs
Pro
Sheet Author
API Scripter
From a quick glance, I suspect that the problem is the hidden input is not at the correct level in the hierarchy. Also you've needlessly complicated things by using divs and spans both as containers, and having one inside the other. Lets look at this:             <div class="classtoggletargeting">                 <span class="baseclasstarget">                     <label>Base Class:</label>                     <input type="hidden" name="attr_baseclass" class="toggle-specializationprestige">                     <select class="long-text-input" type="text" name="attr_baseclass">                         <option value="none" selected>Choose</option>                         <option value="archer">Archer</option>                         <option value="beguiler">Beguiler</option>                         <option value="druid">Druid</option>                         <option value="guardian">Guardian</option>                         <option value="maestra">Maestra (Not Ready)</option>                         <option value="mage">Mage</option>                         <option value="rectora">Rectora</option>                         <option value="pugilist">Pugilist (Not Ready)</option>                         <option value="rogue">Rogue</option>                         <option value="spellbreaker">Spellbreaker (Not Ready)</option>                         <option value="summoner">Summoner</option>                         <option value="warrior">Warrior (Not Ready)</option>                     </select>                 </span>             </div> Why do you have a span inside a div here? You should just have:             <div class="classtoggletargeting baseclasstarget">                     <label>Base Class:</label>                     <input type="hidden" name="attr_baseclass" class="toggle-specializationprestige">                     <select class="long-text-input" type="text" name="attr_baseclass">                         <option value="none" selected>Choose</option>                         <option value="archer">Archer</option>                         <option value="beguiler">Beguiler</option>                         <option value="druid">Druid</option>                         <option value="guardian">Guardian</option>                         <option value="maestra">Maestra (Not Ready)</option>                         <option value="mage">Mage</option>                         <option value="rectora">Rectora</option>                         <option value="pugilist">Pugilist (Not Ready)</option>                         <option value="rogue">Rogue</option>                         <option value="spellbreaker">Spellbreaker (Not Ready)</option>                         <option value="summoner">Summoner</option>                         <option value="warrior">Warrior (Not Ready)</option>                     </select>             </div> I;m not sure if you need both classes, but I moved the spans class into the divs just in case. You can assign multiple classes to a tag, by separating them with a space, and this is often very handy. Furthermore, do these actually need to be inside a container at all? Is there CSS formatting or layout you are applying to this group as a set? The grid layout maybe? If so then keep it as a div - but move the input out of it, like so             <div class="classtoggletargeting baseclasstarget">                     <label>Base Class:</label>                     <select class="long-text-input" type="text" name="attr_baseclass">                         <option value="none" selected>Choose</option>                         <option value="archer">Archer</option>                         <option value="beguiler">Beguiler</option>                         <option value="druid">Druid</option>                         <option value="guardian">Guardian</option>                         <option value="maestra">Maestra (Not Ready)</option>                         <option value="mage">Mage</option>                         <option value="rectora">Rectora</option>                         <option value="pugilist">Pugilist (Not Ready)</option>                         <option value="rogue">Rogue</option>                         <option value="spellbreaker">Spellbreaker (Not Ready)</option>                         <option value="summoner">Summoner</option>                         <option value="warrior">Warrior (Not Ready)</option>                     </select>             </div>             <input type="hidden" name="attr_baseclass" class="toggle-specializationprestige"> This places the input on the same level as the specialisation-archer div, and since you want to affect that div, that's where it needs to be. Note that you can place that input anywhere in the sheet. It will have the same attribute value as the select, no matter where you put it. So you put it where it needs to be to make the CSS work.
1581519809

Edited 1581519984
Actually, reading through what you said earlier several more times, I think I know what's up... it may be possible to fix this. This's going to take awhile though since everything needs to be moved around, but I now know why it was sometimes grouping things as one cell and sometimes two - turns out if you include a label with an input in a span or div tag set, it counts it as a single part and tries to shove them together. Which... is odd, but I can work with this. I'll probably report back in an hour I've set everything on fire. =P EDIT: Just saw your next message popped up while I was typing. I think I have it though now, and yeah, I hadn't realized until just now that I was putting spans inside of divs and it was counting as an extra layer. This probably was the problem since I was counting it as one level but it was probably two. Ooh, that last bit is really handy as well, I thought they had to be right next to each other, not that it could be moved around. That changes an awful lot and may make this easier even! Thanks!
1581519918
GiGs
Pro
Sheet Author
API Scripter
Catreece M. said: Actually, reading through what you said earlier several more times, I think I know what's up... it may be possible to fix this. This's going to take awhile though since everything needs to be moved around, but I now know why it was sometimes grouping things as one cell and sometimes two - turns out if you include a label with an input in a span or div tag set, it counts it as a single part and tries to shove them together. Which... is odd, but I can work with this. Yes, that's why you'd put them in a container - because you want them treated as a single part.
GiGs said: Yes, that's why you'd put them in a container - because you want them treated as a single part. Honestly, I was putting them in containers so I had some way to tell it what I wanted to select since I wasn't sure how to select something like a label otherwise. I think I've almost got an understanding of this finally though. Maybe. We'll see shortly =P
1581521105
GiGs
Pro
Sheet Author
API Scripter
If you want to select a label, just replace div with label in the code, or select it the class name you've given it, not its tag type.
It works it works it works it works XD Whew, thanks so much for all your patience. I think I actually understand this bit now at least! Also, I hadn't realized that labels could have classes added to them, that cleans up a lot of stuff, going to go fix that right now. Just tested and yeah, it totally works, so no more need for messy span tags just around a single label. =P Anyway, yay! It works! Now I can get back to actually building the rest of the sheet up! I've been hung up on this one thing for like three days, but it's definitely made sure I understand how most of the moving parts in the background work so I should be fine on that much for awhile! ...Now I'll find something else to break. =P But before that, wanted to show off one other nice pretty thing I got working earlier while trying to mess with this! Surprisingly, setting up the table for the resistances was a lot easier to do, though it's probably due to not editing nearly as much, just adding extra stuff and changing the order of things. Still, looks nice, so well on the way towards having a fully operational battlesta------character sheet. Yeah. That's it. A character sheet that works. Yep.
1581528207
GiGs
Pro
Sheet Author
API Scripter
That does look pretty nice. And congratulations! figuring out html.css is like bashing your head against a wall and gradually you smash little holes through which you can see :)
GiGs said: That does look pretty nice. And congratulations! figuring out html.css is like bashing your head against a wall and gradually you smash little holes through which you can see :) Well that's an interesting way to put it. It doesn't seem like it's THAT hard though, I just tried to run in and do stuff without knowing what I was doing. If I felt I had the time to read up on how to do this in advance it'd probably not be too awful. It definitely helps having excellent quality help here, though, with people like yourself who can give fairly timely and effective explanations. Unfortunately, most of the websites I'm looking at with guides on how to learn html and css are... clunky, at best. Again though, I'm not exactly reading things in order, and obviously don't have the basics down while trying to mess with advanced stuff, so that's still probably my fault. Oh well, it's how I do things, even if it's not super efficient, but at least it leads to good understanding when stuff does make sense finally. Anyway, thanks again for all the help so far! I'm sure I'll get myself in another interesting mess soon enough. =P   I need a smallish break to add more content as two of my play testers of course had to pick two classes I hadn't finished yet for the game's testing. Sooo I guess I'm building the classes properly so they're ready on time for Friday night's first session. I'll probably sneak in some more updates to the character sheet as I go, though. Focusing too much on one thing gets tiring, so some variety in what I'm working on helps a ton, so I'll probably break something again soon enough!