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

Add checkbox from Worker script

Greetings In a custom sheet I am creating I have a need to create an unspecified amount of checkboxes from a worker script. Would that be possible. Adding and removing sections from a repeating section would be acceptable as long as it could be done without user input. Thx
1527700771
Finderski
Pro
Sheet Author
Compendium Curator
Sheet workers can't create new elements, they'd have to be pre-coded and then the sheet worker could change their state (i.e. checked vs. unchecked).   Also, you can't have nested repeating sections within repeating sections. What are you trying to accomplish? There might other solutions...
Thats what I thought. I am not looking to use nested repeating sections. Just a single one where new 'rows' could be added from a script. As to what I am trying to accomplish, I have a repeating section where the user can add information about pieces of armor. What I want is to place checkboxes somewhere else on the sheet where the user can mark if a piece of armor is being used.  I think I should be able to place a bunch of checkboxes with display:none and then use hidden fields to chain them together with a class that shows them if they if they get a specific value or something, and then use other hidden fields to chain them to the 'rows' in my repeating section with the armor data. If I cant get that to work, the user will simply have to switch to another page to mark them as equipped in the section where the data is entered.
1527704187
Jakob
Sheet Author
API Scripter
Brian J. said: Thats what I thought. I am not looking to use nested repeating sections. Just a single one where new 'rows' could be added from a script. As to what I am trying to accomplish, I have a repeating section where the user can add information about pieces of armor. What I want is to place checkboxes somewhere else on the sheet where the user can mark if a piece of armor is being used.  I think I should be able to place a bunch of checkboxes with display:none and then use hidden fields to chain them together with a class that shows them if they if they get a specific value or something, and then use other hidden fields to chain them to the 'rows' in my repeating section with the armor data. If I cant get that to work, the user will simply have to switch to another page to mark them as equipped in the section where the data is entered. I think what you want to do can be accomplished by simply having 2 instances of the repeating_armor section. If you have 2 repeating sections with the same name, they will share rows. So wherever you want to place the checkboxes, just add another instance of the repeating section, with the only content there being the checkboxes. That should just about do it?
That was exactly what I needed. Thank you.
1528654802
AquaAlex
Sheet Author
Translator
API Scripter
Brian J. said: Thats what I thought. I am not looking to use nested repeating sections. Just a single one where new 'rows' could be added from a script. As to what I am trying to accomplish, I have a repeating section where the user can add information about pieces of armor. What I want is to place checkboxes somewhere else on the sheet where the user can mark if a piece of armor is being used.  I think I should be able to place a bunch of checkboxes with display:none and then use hidden fields to chain them together with a class that shows them if they if they get a specific value or something, and then use other hidden fields to chain them to the 'rows' in my repeating section with the armor data. If I cant get that to work, the user will simply have to switch to another page to mark them as equipped in the section where the data is entered. If the user has to tick for every entry in the repeated section then why not jsut add it to the repeating section?