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

Repeating Fields in Repeating Fields

1580295536

Edited 1580295873
Hey everyone, working on a custom character sheet I haven't touched in a year and trying to make it less cluttered which is unsurprisingly by cluttering up the coding of it. I've been banging my head against a wall of trying to have a repeating field in a repeating field. So something like <fieldset class=repeating_summon> Summon information here     <fieldset class=repeating_summonabilities>     Summon abilities here     </fieldset> </fieldset> The values of the second repeating fields don't save on the live sheet. Or rather, they do, but only when I add a summonabilities field, enter a value, then click out of the field. Then suddenly, all the previous repeating values I've entered appear as separate repeating entries.The values (including the one just created) disappear on closing the character sheet, but the above can be replicated. I've looked at the code for a while and can't figure it out -- my only hypothesis on why it won't work is that you cannot have a repeating field within a repeating field without this issue. Does anyone know for sure or is there something else to consider? Here are some things I tried: Ensured all values in both fields have an attribute associated with them Ensured all lines have input type="text" or type="number" as appropriate Thank you.
1580297045
Andreas J.
Forum Champion
Sheet Author
Translator
I'm not entirely sure you can create repeating sections inside repeating section. Can't on the top of my head recall any sheet doing this, but I might be mistaken. Depending on if you know how many entries you might expect on either part, you could fake either repeating section and instead just hide entries until they are needed.
Hey Andreas, thank you for the reply. I think the repeat-in-repeat may just be a hard limitation on what I'm trying to do here and was looking to consider alternatives. The idea of hidden sections is actually pretty interesting. I'd expect to have no more than 4 entries of the second part so having checkmarks to reveal them on a row at the end of it all is likely the way I'll end up going. That being said, I'm a little novice at all this, specifically Roll20's system. Is there an example sheet or post you can think of that utilizes such a thing? I'd like to be able to have 4 individual checkmarks with each revealing a section (all identical save attribute names). If not, I'll likely figure it out one way or another through searching and you've already helped enough with the excellent idea. Thanks again!
1580301999
Andreas J.
Forum Champion
Sheet Author
Translator
CSS Wizardry have examples of hiding/showing areas. Read the Building Character Sheets main article to find links, tips & more resources. I don't remember any specific example of this but there should be some sheet who have used it.
1580322278
GiGs
Pro
Sheet Author
API Scripter
Unfortunately you have hit a hard limit - roll20 doesnt support nested repeating sections. It would be so handy if you could have them, even just one level - repeating section inside repeating section - would add so much potential. If you do absolutely need the appearance of a repeating field inside a repeating field, you can kind of fake it, by using CSS to hide sections. So you have a fake add/delete button, which changes a hidden attribute's value, and the value sets how many of the hidden rows to show. But you do have to hardcode how many rows or fields the hidden section will contain, so there's an upper limit, and you dont want to go overboard because the biggest source of lag in character sheets is the number of attribute they have, whether visible or not. If your sheet is less complex than, say, the D&D 5e by roll20 sheet, you should be fine. Just decide on some reasonable limit.
Back after learning some new tricks and did what was recommended -- having hidden sections that appear when corresponding radios are selected (I chose to do radios for the aesthetic). Thank you all for the help and GiGs, it is very helpful to have a definite know that that nested repeating sections are a no-go in roll20. I appreciate it!
1580333838
Finderski
Plus
Sheet Author
Compendium Curator
GiGs said: If you do absolutely need the appearance of a repeating field inside a repeating field, you can kind of fake it, by using CSS to hide sections. So you have a fake add/delete button, which changes a hidden attribute's value, and the value sets how many of the hidden rows to show. If you want to get real tricky, you could use action buttons that trigger a sheet worker to increment/decrement a field to show/hide those hidden fields...
1580344760
Mike W.
Pro
Sheet Author
There is a suggestion submitted for this. If you have any votes left, please add your voice to the suggestion. <a href="https://app.roll20.net/forum/post/2942465/nested-repeating-sections" rel="nofollow">https://app.roll20.net/forum/post/2942465/nested-repeating-sections</a>