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

Problem With Repeating Skills

Guys, every time I add a field in one of my repeating skills, it gets added to the other fields. I can't figure out why. Any help? Here is the code: <div class='sheet-col injury'>   <h3>Ferimentos:</h3>     <fieldset class="repeating_skills">         <div class='sheet-col'>             <input type="checkbox" name="attr_injury" class="checkboxInjury">         </div>     </fieldset> </div>  <h3>Técnicas:</h3>       <fieldset class="repeating_skills">                     <input type="text" name="attr_skillname2" placeholder="Nome da Técnica"/> <br />             <span>Tipo de Técnica:</span><br />         <select name="attr_skilltype" class="tipo" checked='true'>           <option>Agarrão</option>           <option>Bloqueio</option>           <option>Combo</option>           <option>Evasão</option>           <option>Golpe</option>           <option>Nenhum</option>           <option>Projétil</option>         </select> <br />                  <span>Elemento de Técnica:</span><br />         <select name="attr_skillelement" class="tipo" checked='true'>           <option>Água</option>           <option>Ar</option>           <option>Éter</option>           <option>Fogo</option>           <option>Terra</option>         </select><br />         <span>Descrição da Técnica:</span>         <textarea name="attr_skilldescription" placeholder="Descrição da Técnica" rows="10" cols="40"></textarea><br />           Nagen <input type="number" style="width:40px;height:30px" name="attr_nagen"> Dano <input type="number" style="width:40px;height:30px" name="attr_damage">           Ougi <input type="checkbox" name="attr_ougi"> <input type:"text" style="width:300px" placeholder="Efeito do Ougi" name="attr_ougieffect"><br />               <p> </p>       </fieldset>   <div> <h3>Laços:</h3>     <fieldset class="repeating_skills">         <tr>             <td><input type="text" name="attr_skillname1"></td>             <td><input type=checkbox name="attr_skillname_select1"></td>         </tr>     </fieldset>
1532622353

Edited 1532622652
vÍnce
Pro
Sheet Author
It looks like you're using the same class name for each fieldset.  Each fieldset should have a unique name. If you want one repeating section for skills, you should wrap your skill section html elements within a single fieldset.  Also, each class name, other than fieldsets, should start with "sheet-".
but if I change the class name to something other than "repeating skills" I lose the effect of adding/modifying, don't I?
1532624294
GiGs
Pro
Sheet Author
API Scripter
Its the "repeating_" part you need to keep. You can have, for instance, sections named "repeating_spells", "repeating_inventory" and so on. You can have "repeating_" + anything, just as long as each section is different.
1532624582

Edited 1532624600
vÍnce
Pro
Sheet Author
You still need to use "repeating_foo" for repeating sections, but each fieldset must have a unique name. "repeating_foo", "repeating_foo2", "repeating_foo3" etc. I believe that you need to use a single fieldset for skills ie "repeating_skills"  Just include all your skill related elements inside that single fieldset.
OK, I think I solved it, but now I'm having another problem. The new fields are erasing themselves! What did I do wrong? <div class='sheet-col injury'>   <h3>Ferimentos:</h3>     <fieldset class="repeating_wounds">         <div class='sheet-col'>             <input type="checkbox" name="attr_injury" class="checkboxInjury">         </div>     </fieldset> </div> <h3>Laços:</h3>     <fieldset class="repeating_bonds">         <tr>             <td><input type="text" name="attr_bondname"></td>             <td><input type=checkbox name="attr_bondname_select"></td>         </tr>     </fieldset>
1532629701
GiGs
Pro
Sheet Author
API Scripter
What exactly do you mean by erasing themselves, and does it happen with all fieldsets, or just one of them? In your bonds fieldset you have table elements, but dont have a <table></table> definition. It should probably look like this: <h3>Laços:</h3> <table>     <fieldset class="repeating_bonds">         <tr>             <td><input type="text" name="attr_bondname"></td>             <td><input type=checkbox name="attr_bondname_select"></td>         </tr>     </fieldset> </table> Also, you are likely to have issues with that checkbox. Checkboxes over multiple rows of a fieldset do not have the same name, so you wont be able to click one and have it automatically deselect the others. (Try it and see what happens.)
G G said: Also, you are likely to have issues with that checkbox. Checkboxes over multiple rows of a fieldset do not have the same name, so you wont be able to click one and have it automatically deselect the others. (Try it and see what happens.) Oh, that's exactly what I want, actually.
1532708606
GiGs
Pro
Sheet Author
API Scripter
I guessed that's what you wanted, which is why I warned you that it wont happen. It's very tricky to set that up in a repeating fieldset. I think you have to build a sheetworker function to make it happen, or move the selection outside of the fieldset (which adds its own complications).