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

Datalist - what's the syntax?

1648361433

Edited 1648361449
GiGs
Pro
Sheet Author
API Scripter
How do you use datalists in roll20? Do you need any CSS to get them to work? I have the following < datalist id = "ability_scores" >     < option value= "@{strength}" > Strength </ option >     < option value= "@{dexterity}" > Dexterity </ option >     < option value= "@{constitution}" > Constitution </ option >     < option value= "@{intelligence}" > Intelligence </ option >     < option value= "@{wisdom}" > Wisdom </ option >     < option value= "@{charisma}" > Charisma </ option > </ datalist > < input type= "text" name= "attr_ability_scores" list= "ability_scores" > I just get an empty input, which functions exactly like an input, with the list of data shown fully before it.
1648362197

Edited 1648362208
GiGs
Pro
Sheet Author
API Scripter
Never mind - I somehow had legacy set to true on the character sheet I was testing. It's working! That said, it's not showing the full list the way a select does. When you first click in the box, it's empty, then when you type a letter it shows a dropdown of all values containing that letter. Is there a way to get it to show all values in the list, until you start typing?
1648363657

Edited 1650801292
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: Is there a way to get it to show all values in the list, until you start typing? If you select an empty input, it should show as dropdown all the options(might be a fraction of a second delay before dropdown appears). That's what happens for me on firefox. As usual, the wiki have examples: <a href="https://wiki.roll20.net/CSE#Datalist" rel="nofollow">https://wiki.roll20.net/CSE#Datalist</a>
1648363936

Edited 1648364296
GiGs
Pro
Sheet Author
API Scripter
Interesting. It seems the list only appears if I click twice . If I click once to select the input, nothing appears, and then if I click in the box again while it already has focus, the list appears. Is that how it normally works? No delay of any length causes it to appear, it needs that second click. I'm on Firefox too.