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 section sets back

Hello gamers, with my limited html-skills I tried to create a repeating section of skills (language+12: "X", language+14: "Y"...) with a selection in it which gets the actual skill (language, law, read/write, ...). It basically worked out so far, but my problem is that the selection-field is always resetting itself to the first choice possible (in this case "language" = "Sprechen") and does not save other choices below the top choice of that selection. Is there a way to make the selection not set itself back to the top option no matter what you choose? <fieldset class="repeating_Mehrfachfertigkeiten">             <table>                 <tr>                     <td><select class="skill-input" name="attr_Mehrfachfertigkeit" style="width: 100px;"></td>                         <option name="attr_Sprechen" value="@{Mehrfachfertigkeit}">Sprechen</option>                         <option name="attr_Schreiben" value="@{Mehrfachfertigkeit}">Schreiben</option>                         <option name="attr_Landeskunde" value="@{Mehrfachfertigkeit}">Landeskunde</option>                         <option name="attr_Überleben" value="@{Mehrfachfertigkeit}">Überleben</option>                     </select></td>                     <td class="skill-label"><input style="width:100%" type="text" name="attr_Gebiet" /></td>                     <td><input class="skill-input" type="number" name="attr_Mehrfachfertigkeit" style="width: 50px;" /></td>                     <td><button type='roll' value='&{template:default} {{name=Erfolgswurf}} {{Ergebnis=[[1d20+@{Mehrfachfertigkeit}+@{Intelligenzbonus}+?{Würfelmodifikator (WM)|0}]]}}' name='roll_Mehrfachfertigkeit' /></td>                 </tr>             </table>         </fieldset> Thanks for help in advance! :)
Baldor said: Note to specify : Alba is a land, not a language ("Sprechen"), so I want it to stay with "Landeskunde" ("lore of the land"), but all the time I set it back to "Landeskunde", it looses its value, but when I set the value, it changes to "Sprechen" Alba again...
1546530427

Edited 1546530523
GiGs
Pro
Sheet Author
API Scripter
There's a couple of things wrong. Your select field looks like its incorrect. I think it should be <td><select class="skill-input" name="attr_Mehrfachfertigkeit" style="width: 100px;"></td>                         <option value="Sprechen" >Sprechen</option>                         <option value="Schreiben" >Schreiben</option>                         <option value="Landeskunde" >Landeskunde</option>                         <option value="Überleben" >Überleben</option>                     </select></td> Though maybe those values should be numbers? I don't know what those words translate to, so cant guess at what numbers they should be. Whataver the case, the value definitely isnt  @{Mehrfachfertigkeit} because that's also the name of the select: you are referring back to itself in a circular reference. This input <input class="skill-input" type="number" name="attr_Mehrfachfertigkeit" style="width: 50px;" /> Is using the same name as the select. This seems to be redundant. If one is a word, and the other is a number, the select and input need different attribute names.
GiGs said: There's a couple of things wrong. Your select field looks like its incorrect. I think it should be <td><select class="skill-input" name="attr_Mehrfachfertigkeit" style="width: 100px;"></td>                         <option value="Sprechen" >Sprechen</option>                         <option value="Schreiben" >Schreiben</option>                         <option value="Landeskunde" >Landeskunde</option>                         <option value="Überleben" >Überleben</option>                     </select></td> Thank you, GiGs! I changed that html-part, but unfortunately it still does reset itself and erases the value afterwards. Don't worry about the translations (Sprechen=Speak, Schreiben=Write, Landeskunde=Lore of the land, Überleben=Survive, Mehrfachfertigkeit=Multiple skill) . Changing the selection is not a problem, but after I changed it for - let's say "Landeskunde" - the field with a number afterwards changes to " ". When I get to type in a number, the selection set itself back to "Sprechen" (the choice on the top). The central text-field remains unchanged (at least that's good). "Though maybe those values should be numbers?" I cautiously do not think so? The number is entered in the third field. As long as I don't change "Sprechen" to another skill, it's fine and all numbers stay. But as soon as I pick another skill (e.g. "Überleben), the number is lost....:( The idea is: 1. You pick a skill (like "Sprechen") your character learned 2. You pick a field of knowledge within that skill (like "English") - that's the second field 3. You enter a value of that skill (like "14") - that's the third field 4. For tests on that particular special-skill you press that button. The skills listed all have specific fields where you must specialize in when you learned that skill. So you can learn any of those skills multiple times each with different specifics ("English", "French", "Spanish", ...) and different skill-levels. But you can also add "Überleben" (Survive) and then pick for instance "Desert" or "Wood" etc.
1546532254

Edited 1546532430
GiGs
Pro
Sheet Author
API Scripter
Your 1st and 3rd fields are using the same name. One is a word, and the other is a number. This is why it keeps resetting. It's recognising the values are incompatible and conflicting, and keeps resetting to default. You need to change one of those two attribute names. The first one would be simplest, so you dont also have to change the button value.
GiGs said: Your 1st and 3rd fields are using the same name. One is a word, and the other is a number. You need to change one of those two attribute names. The first one would be simplest, so you dont also have to change the button value. Ah, heureka, it worked! After 3 days, html is still quite new to me...Thank you :)
1546532933
GiGs
Pro
Sheet Author
API Scripter
You're welcome :) html is quite tricky!