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

[Question] Repeating section within a table sometimes doesn't get added

1483729513
Loki
Sheet Author
Hi! I'm working on my first character sheet for a german RPG and am encountering a strange behaviour of a repeating section (or, to be honest, with all my repeating sections). When I click on the "add"-button to add two <td>-elements, each filled with two <input>-elements, sometimes the elements are added - and sometimes not. When they are not, the "blink" (the appear for a short time) and then disappear as if the were deleted. I've tried many things and am working on this since hours, but don't find the answer to this. Whenever I copy a repeating section that do the same from another character sheet, they work as intended, but than something terrible seems to go wrong, because when I make the changes I want to do to the copied original repeating section (e.g. from the great Pathfinder sheet), they begin to stuck again. It's weird because there doesn't seem to be a pattern. Sometimes I can add 7 oder 8 elements properly, sometimes (after reloading the sheet) the first repeating section I want to add just blinks and vanished. I can click on "add" after that and then the section gets added, but I may encounter the same problem with the next click on "add". For example the following code (from the pathfinder sheet) works perfectly fine: <fieldset class="repeating_weapons">             <table cellpadding="0" cellspacing="0">                 <tr>                     <td colspan="3" class="sheet-statlabel-big" style="font-size: 1.5em; width: 260px;">Weapon</td>                     <td class="sheet-statlabel" style="width: 110px;">Attack Bonus</td>                     <td class="sheet-statlabel" style="width: 100px;">Critical</td>                 </tr> </table> </fieldset> But my actual code (following the same principle) doesn't: <fieldset class="repeating_Ressources">                         <table cellpadding="0" cellspacing="0">                             <tr>                                 <td><input type="text" name="attr_ressourcenames" style="width: 15em; font-weight: bold; background-color:#81BEF7"></td>                                 <td><input type="number" name="attr_ressourcepoints" style="width: 5em; font-weight: bold; background-color:#81BEF7"></td>                             </tr>                                    </table> </fieldset> Then the code with input-elements (from the pathfinder sheet) also doesn't work (the text boxes blink): <fieldset class="repeating_Ressources">         <table cellpadding="0" cellspacing="0"> <tr>                     <td colspan="3"><input class="sheet-inputbox" type="text" name="attr_weaponname" style="height: 24px; width: 260px;"></td>                     <td><input class="sheet-inputbox" type="number" name="attr_weaponattackbonus" style="height: 24px; width: 110px;"></td>                     <td><input class="sheet-inputbox" type="number" name="attr_weaponcritical" style="height: 24px; width: 100px;"></td>                 </tr>   </table> </fieldset> The whole section is part of a super-table, that aligns the several sub-tables and this is the whole code (of that table): <td align="center">                 <div>                     <table cellpadding="0" cellspacing="0">                         <tr>                             <td colspan=2>                                 <b style='display: inline-block; width: 15em; font-size:25'>Ressourcen</b>                             </td>                         </tr>                         <tr>                             <td><input type="text" name="attr_Ansehen" style="width: 15em; font-weight: bold" disabled="true" value="Ansehen" /></td>                             <td><input type=number name="attr_Ansehenswert" min="-2" style="width: 5em; font-weight: bold; background-color:#81BEF7; text-align: center" value=0></td>                         </tr>                         <tr>                             <td><input type="text" name="attr_Kontakte" style="width: 15em; font-weight: bold;" disabled="true" value="Kontakte" /></td>                             <td><input type=number name="attr_Kontaktewert" min="-2" style="width: 5em; font-weight: bold; background-color:#81BEF7; text-align: center" value=0></td>                         </tr>                         <tr>                             <td><input type="text" name="attr_Stand" style="width: 15em; font-weight: bold;" disabled="true" value="Stand" /></td>                             <td><input type=number name="attr_Standwert" min="-2" style="width: 5em; font-weight: bold; background-color:#81BEF7; text-align: center" value=0></td>                         </tr>                         <tr>                             <td><input type="text" name="attr_Vermögen" style="width: 15em; font-weight: bold;" disabled="true" value="Vermögen" /></td>                             <td><input type=number name="attr_Vermögenswert" min="-2" style="width: 5em; font-weight: bold; background-color:#81BEF7; text-align: center" value=0></td>                         </tr>                     </table>                 </div>                     <fieldset class="repeating_Ressources">                         <table cellpadding="0" cellspacing="0">                                 <tr>                                     <td colspan="3"><input class="sheet-inputbox" type="text" name="attr_weaponname" style="height: 24px; width: 260px;"></td>                                     <td><input class="sheet-inputbox" type="number" name="attr_weaponattackbonus" style="height: 24px; width: 110px;"></td>                                     <td><input class="sheet-inputbox" type="number" name="attr_weaponcritical" style="height: 24px; width: 100px;"></td>                                 </tr>                                    </table>                     </fieldset>                 </td> Did anyone already encounter this error or can help me out with some piece of advice? That would be awesome! Greetings, Loki
1483737121
Tetsuo
Forum Champion
I've noticed a similar behavior in a lot of sheets. It specifically occurs if you're editing a repeating field, and add a new one while the text cursor is still inside the first one, the new one disappears. Dunno if this is the issue you're having, but it sounds similar
1483777653

Edited 1483777727
vÍnce
Pro
Sheet Author
Not sure what you mean by "the text boxes blink"...? Also, I would suggest, not using capitalized class names in your repeating sections/fieldsets.   <fieldset class="repeating_ R essources"> recommended <fieldset class="repeating_ressources"> Might not still be an issue, but I've encountered errors with buttons being dragged and dropped to the quickbar when using a fieldset class name with capital letters.  Something to do with the way the roll20 converts to lowercase.  Not sure if it would also cause other strangeness.
1483784608

Edited 1483784657
Loki
Sheet Author
Franky H. said: I've noticed a similar behavior in a lot of sheets. It specifically occurs if you're editing a repeating field, and add a new one while the text cursor is still inside the first one, the new one disappears. Dunno if this is the issue you're having, but it sounds similar First: Thank you for answering! I created a few games with different precast character sheets (Pathfinder, Shadowrun) and I can confirm your observation: Everytime when there are repeating sections with input fields, this error occurs. When I add a new section via the add-button while the input field is focussed (the cursor is there), the newly added section vanishes as if it had been deleted. When I do not focus the input field and then add a repeating section, it will in most cases work perfectly fine. Thank you for sharing this observation. I guess, there isn't anything that we as character sheet authors can make here. Vince said: Not sure what you mean by "the text boxes blink"...? Also, I would suggest, not using capitalized class names in your repeating sections/fieldsets.   <fieldset class="repeating_ R essources"> recommended <fieldset class="repeating_ressources"> Might not still be an issue, but I've encountered errors with buttons being dragged and dropped to the quickbar when using a fieldset class name with capital letters.  Something to do with the way the roll20 converts to lowercase.  Not sure if it would also cause other strangeness. Thank you for answering! Sorry for my insufficient wording. When I click on the "add" button beneath the repeating section the first time, a new section appears. But when I click on the "add" again, chances are that the newly added repeating section (with two input elements) appears for a short time (half a second maybe) and then vanished/disappears (as if I had click on the delete-button). Franky already supposed that this has to do with the focus of the input box. If the cursor is in the input box while I add a new section, it's highly likely that it vanishes (but if I try it again it always appears, I guess because the input box did lose the focus). I also altered the class of the fieldset, but it didn't do the trick. The question is: Do the roll20-developers know of this bug and if not, should they be informed? I think, after all, it's a very small inconvenience. Greetings, Loki
1483786530
vÍnce
Pro
Sheet Author
I don't think it's a bug.  Repeating attributes don't necessarily exist (no assigned id's) until you add something/anything to one of it's repeating attributes.  If you add 3 new repeating rows and start entering data in one of them, the others will vanish as you try moving into either of the the other two rows.  Again, AFAIK, you must add repeating items one at a time.  ;-(
1483790187

Edited 1483790202
Loki
Sheet Author
Vince said: I don't think it's a bug.  Repeating attributes don't necessarily exist (no assigned id's) until you add something/anything to one of it's repeating attributes.  If you add 3 new repeating rows and start entering data in one of them, the others will vanish as you try moving into either of the the other two rows.  Again, AFAIK, you must add repeating items one at a time.  ;-( Thank you again for your input! I've tested your theory: I've filled in a text / a number in both input fields and clicked on "add". When the cursor is in the right hand field with the number... ... the error occurs, the new repeating section is created and vanishes immediately.  But if the cursor is in the left hand field... ...everything works fine and a new section is added without vanishing. Doesn't this sound like a bug? It should be completely irrelevant where the cursor is. It doesn't seem to have to do with the amount of input fields I want to add since this... ...also leads to the error of the vanishing repeating sections, although there is only one element in the section. Greetings, Loki
You're right that it does not matter where the cursor is; it matters whether there is data in the field or not. And data in an input field is not saved until the cursor leaves the field. It's a best practice to tab out of a field or click in another field when you have entered data in a field.
1483871685
Loki
Sheet Author
Rabulias said: You're right that it does not matter where the cursor is; it matters whether there is data in the field or not. And data in an input field is not saved until the cursor leaves the field. It's a best practice to tab out of a field or click in another field when you have entered data in a field. Thank you for your answer! If this is the problem, then I guess there's nothing that I as the developer can make here (besides writing a good documentary that covers up this topic). Greetings, Loki