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

Displaying text in inputs

I have a series of radio buttons with values like 'Vitals (-3)' I have two different areas on the sheet where I reference this - one is a number input which shows the modifier value and works fine. The other is a text input which I want to display the full string, but it only shows the numeric value. Is there any way around this?
1402981030
Lithl
Pro
Sheet Author
API Scripter
Is the player expected to use either or both of these inputs as an attribute? I can think of a way to get the presentation you want, but the method I'm thinking of won't set the attributes correctly for the player to use if that's intended.
It's mostly just for informational purposes. The sheet I'm working on looks like this: As you can see, it is just posting the numeric value, not the whole text, which should read 'Right Arm (-2)'
Not going to lie, that is a very visually pleasing sheet. Those tabs are beautiful!
1402991795

Edited 1402991895
Lithl
Pro
Sheet Author
API Scripter
If it's purely for informational purposes, you could do something like this: jsfiddle <input class="sheet-vitals" type="radio" name="attr_vitals" value="1" checked="true" /> Head (-1) <input class="sheet-vitals" type="radio" name="attr_vitals" value="2" /> Shoulders (-2) <input class="sheet-vitals" type="radio" name="attr_vitals" value="3" /> Knees (-3) <input class="sheet-vitals" type="radio" name="attr_vitals" value="4" /> Toes (-4) <div> <span class="sheet-modifier"></span> <span class="sheet-target"></span> </div> Note that there isn't anything wrapping around the radio buttons that isn't also wrapping around the two spans. The spans are both descendants of a sibling to the radio inputs. This is important. The same is true of your tabs, I'm certain. span.sheet-modifier, span.sheet-target { display: inline-block; border: 1px inset #c0c0c0; box-shadow: #e4e4e4 0px 1px 2px 0px inset; background-color: #ebebe4; width: 50px; height: 20px; margin: 2px; } span.sheet-target { width: 150px; } span.sheet-modifier::before, span.sheet-target::before{ padding-left: 10px; } input.sheet-vitals[value="1"]:checked ~ div > span.sheet-modifier::before { content: "-1"; } input.sheet-vitals[value="2"]:checked ~ div > span.sheet-modifier::before { content: "-2"; } input.sheet-vitals[value="3"]:checked ~ div > span.sheet-modifier::before { content: "-3"; } input.sheet-vitals[value="4"]:checked ~ div > span.sheet-modifier::before { content: "-4"; } input.sheet-vitals[value="1"]:checked ~ div > span.sheet-target::before { content: "Head (-1)"; } input.sheet-vitals[value="2"]:checked ~ div > span.sheet-target::before { content: "Shoulders (-2)"; } input.sheet-vitals[value="3"]:checked ~ div > span.sheet-target::before { content: "Knees (-3)"; } input.sheet-vitals[value="4"]:checked ~ div > span.sheet-target::before { content: "Toes (-4)"; } You can see that we're actually just displaying text before a span element, not populating an input field. But, if all you need is the display and not an actual attribute (beyond the radio element), then it'll work just fine!