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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Repeating sections cannot display attributes whose inputs have no type (Character Sheet Development)

Inputs in repeating sections need to be explicitly types as text in order to display information within the repeating section template. If an input is included with no type, it behaves improperly and may not store data. This code will reproduce the issue: < h3 > Skills < /h3 > < fieldset class = "repeating_skills" > < button type = "roll" name = "roll_skill" value = "/em uses @{skillname}, and rolls [[@{dtype}]]" > <span name="attr_skillname"></span> < /button >    < input name = "attr_skillname" value = "" > < select name = "attr_dtype" class = "dtype" > < option value = "d6" > d6 < /option > < option value = "d10" > d10 < /option > < /select > < /fieldset > while this code will work as expected: < fieldset class = "repeating_skills" > < button type = "roll" name = "roll_skill" value = "/em uses @{skillname}, and rolls [[@{dtype}]]" > <span name="attr_skillname"></span> < /button >    < input type="Text"name = "attr_skillname" value = "" > < select name = "attr_dtype" class = "dtype" > < option value = "d6" > d6 < /option > < option value = "d10" > d10 < /option > < /select > < /fieldset > Text is the default type for input so these two code snippets should behave the same way. Description of setup Browser + Version: Firefox 98.0.2 Browser Addons/Extensions: None applicable Operating System: Linux
1648870182

Edited 1648875156
Oosh
Sheet Author
API Scripter
Yyyyyyyeah, that probably isn't a great idea, even if you're the only one working on the code. Javascript (or jQuery, which Roll20 uses) and CSS are going to be tripped up by that if they try to use the [type=] selector. That's going to ruin some inbuilt functionality (as you've discovered) and also frustrate anyone trying to do CSS on top of your HTML. That's on top of best practices, readable code, yaddah yaddah yaddah... Possibly worth adding to the character sheet development quirks though.
1648930691
Andreas J.
Forum Champion
Sheet Author
Translator
You should always define type for inputs, so not really a bug, roll20 just enforces some HTML best practices.