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
This post has been closed. You can still view previous posts, but you can't post any new replies.

HTML 5 datalists, Possible to use?

February 04 (7 years ago)

Edited February 04 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So, I'm wondering if it is possible to use html5 datalist elements in character sheets.

A few problems I've run into while attempting them:
  • They require the use of IDs, which according to the Wiki and basic HTML/CSS coding shouldn't be done because they are not unique elements (unless of course you have only a single character).
    • Since the id is just to specify a list to pull data from, and the list is static, it shouldn't (and as far as I can tell doesn't) cause any problems to use IDs in this one instance.
  • Roll20 appears to strip out the <datalist> and </datalist> tags on load.
    • However, if you then use the browser editor to edit where the datalist should have been in the character sheet, it does work as expected. Anyone have any ideas for getting this to work fully though?
February 04 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
That would be a pretty nifty feature to have.
February 05 (7 years ago)
Lithl
Pro
Sheet Author
API Scripter

Scott C. said:

  • Roll20 appears to strip out the <datalist> and </datalist> tags on load.
    • However, if you then use the browser editor to edit where the datalist should have been in the character sheet, it does work as expected. Anyone have any ideas for getting this to work fully though?
Roll20 does a rather significant amount of manipulation to your HTML (and CSS) to ensure someone can't break the page. After all, when we create a character sheet, we are injecting arbitrary HTML, CSS, and even JavaScript into the VTT page, which has significant potential for vulnerability.

Getting this to work would require convincing the devs to alter the sanitization code to allow datalists. I recommend making a thread in the suggestions forum.
February 05 (7 years ago)

Edited February 05 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks Brian,

I was hoping someone like you that knew more about html/css would have a workaround, but that doesn't really surprise me. I'll go make the suggestion I suppose, and maybe we'll be able to use them in 5 years or so.

EDIT: Suggestion made