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

Range Inputs in custom character sheets

April 20 (3 months ago)

I've been trying to create a custom character sheet with some of the inputs as sliders (html: <input type="range" name="attr_saturation> for an example)

I'm noticing inputs I make with this don't seem to update the corresponding attribute. Is this intended behavior? Is there some way to circumvent this?

April 20 (3 months ago)
GiGs
Pro
Sheet Author
API Scripter

There are only a few inputs supported on roll20, and ranges are not one of them.

supported: text, number,checkbox, radio, and hidden (the latter being a special one for roll20).

April 20 (3 months ago)

Thanks for the prompt reply!

That's quite unfortunate- I guess I'll stick to just using them as indicators and using a number box to modify the actual attribute then.

I can't even use a sheet worker to try to update a different input because the sheet workers don't run unless an attribute is modified.


April 20 (3 months ago)

Edited April 20 (3 months ago)
vÍnce
Pro
Sheet Author

I was curious and did a search on roll20's repo for type="range" and there were four sheets that appear to use it in their code.  The B&B sheet appears to use it for it's XP
https://github.com/Roll20/roll20-character-sheets/blob/26b83245070c90ca362e50bada58447f13c2f1a1/Bunkers%26Badasses/bnb.html#L856

I'm not sure it actually works as you would expect on roll20 though.  But it might be worth a look.
Cheers

April 20 (3 months ago)
GiGs
Pro
Sheet Author
API Scripter

This is a time to look at the CSS Wizardry page on the wiki.


Range is recognised as an input, but its usual features don't work on roll20. I do remember people have reproduced similar effects, so those sheets Vince mentioned and the CSS wizardry page are where I'd start looking.

April 20 (3 months ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Yep, you can use a range as a display. The user just can't edit the attribute by manipulating the range. Depending on how granular your range needs to be and/or how many values it needs to have, you can do some decent replication of a range with the fill to left trick.

April 30 (2 months ago)

I'm going to add my own contribution to the corpus here- I have been using a range as a display- and using the css property:

pointer-events: none

on the range disables a user from editing the range by mistake, (and thereby also helps make sure users don't accidentally think editing the range is a way of modifying the attribute)