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

Identical Dropdown menus in a character sheet.

Apologies if this sounds like a basic question and sorry if this is in the wrong location. I'm currently creating my own character sheet and it contains a dropdown menu with 20+ items on it. I would like to have the same drop down menu (with a different unique ID) in multiple places on the character sheet. Is there a way to do this without copying the code wholesale and just changing the ID? Thank you for any response. I can post some example code later if needs be.
1529655956
Finderski
Pro
Sheet Author
Compendium Curator
By "ID" I hope you mean "name", because according to the  Building Character Sheets wiki IDs can't be used. Only Use Classes, not IDs You should not use IDs on your tags (for example, DO NOT do <input type='text' id='name' /> ). Since there are multiple copies of each sheet in the DOM at once, using an ID is incorrect since IDs should only be used on unique elements. As to whether there's a way to do what you want without copying the code...not that I know of.
1529692875
GiGs
Pro
Sheet Author
API Scripter
I'm pretty sure you have to copy the full dropdown each time.
1529694742
The Aaron
Pro
API Scripter
There are ways to get around it, but it involves some development tools to compile the character sheet out of many separate files which might be more than you want to get involved in.
@Finderski - Looking at the sheet I've used for a template you are correct about name not ID. Thanks for the heads up. Thanks all. Shame, but it is what it is. Update Has anyone used fieldsets?
1529812363
Finderski
Pro
Sheet Author
Compendium Curator
John D. said: Update Has anyone used fieldsets? Within a Roll20 character sheet, fieldsets are how you set up repeating sections, so yep. :)
1529862393
Jakob
Sheet Author
API Scripter
Finderski said: John D. said: Update Has anyone used fieldsets? Within a Roll20 character sheet, fieldsets are how you set up repeating sections, so yep. :) Conversely, you probably should not use fieldsets for anything else, it will probably break stuff :).
Cheers all. Will give it a go tonight and see how I get on.