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

[Code] Long list of options not supported ?

Hello ! I tried to make some list of weapons but a friend, one of my players, said he got problems with the list. Here is it (it's in french) : <a href="http://puu.sh/tR9og/6131019034.jpg" rel="nofollow">http://puu.sh/tR9og/6131019034.jpg</a> With the complete code here : &lt;label style="margin-top: 25px;"&gt;Arme(s) :&lt;/label&gt; &lt;select style="width: 110px" name="attr_Arme"&gt; &lt;option value="2d4"&gt;Poings / pieds / sabots&lt;/option&gt; &lt;option value="1d6"&gt;1 Arbalète de poing&lt;/option&gt; &lt;option value="2d5"&gt;2 Arbalètes de poing&lt;/option&gt; &lt;option value="1d8"&gt;Arbalète légère&lt;/option&gt; &lt;option value="1d10"&gt;Arbalète lourde&lt;/option&gt; &lt;option value="1d6"&gt;Arc court&lt;/option&gt; &lt;option value="1d8"&gt;Arc long&lt;/option&gt; &lt;option value="1d4"&gt;Couteau de lancer&lt;/option&gt; &lt;option value="1d6"&gt;Hache de lancer&lt;/option&gt; &lt;option value="1d6"&gt;Orbe magique&lt;/option&gt; &lt;option value="1d6"&gt;Pistolet magique&lt;/option&gt; &lt;option value="1d8"&gt;Fusil magique&lt;/option&gt; &lt;option value="1d10"&gt;Canon magique&lt;/option&gt; &lt;option value="1d6"&gt;Bâton&lt;/option&gt; &lt;option value="1d8"&gt;Bâton de guerre&lt;/option&gt; &lt;option value="1d4 (1d10 en traître, mort par surprise)"&gt;1 dague&lt;/option&gt; &lt;option value="2d4 (2d6 en traître, mort par surprise)"&gt;2 dagues&lt;/option&gt; &lt;option value="1d6"&gt;1 épée courte&lt;/option&gt; &lt;option value="2d5"&gt;2 épées courtes&lt;/option&gt; &lt;option value="1d8"&gt;Épée dite bâtarde&lt;/option&gt; &lt;option value="1d10"&gt;Épée longue&lt;/option&gt; &lt;option value="1d6"&gt;Massue&lt;/option&gt; &lt;option value="1d8"&gt;1 hache à 1 main&lt;/option&gt; &lt;option value="2d7"&gt;2 haches à 1 main&lt;/option&gt; &lt;option value="1d10"&gt;Hache à 2 mains&lt;/option&gt; &lt;option value="1d6"&gt;Lance&lt;/option&gt; &lt;option value="1d8"&gt;Hallebarde&lt;/option&gt; &lt;option value="1d10"&gt;Marteau&lt;/option&gt; &lt;option value="2d6"&gt;Cornes&lt;/option&gt; &lt;option value="1d10*1d4"&gt;Épines&lt;/option&gt; &lt;option value="2d6"&gt;Griffes&lt;/option&gt; &lt;option value="1d6+3"&gt;Morsure puissante&lt;/option&gt; &lt;option value="1d8"&gt;Os&lt;/option&gt; &lt;/select&gt; The problem is when he select something like "Bâton" and close the sheet, he got the "Lance" when he reopen it. Is it because the list is too long ? Then, a question about options : Is it possible, or supported, to identify an option by a number for exemple, like "option 1 value ="xx"" ? Maybe it's because of this ? Thanks in advance !
1486412108

Edited 1486412331
Lithl
Pro
Sheet Author
API Scripter
If you have multiple options with the same value attribute, you will get unexpected behavior. When you select an option, Roll20 saves that option's value as the value of the backing attribute. When you open the sheet, Roll20 looks at the backing attribute and picks the option to show as selected based on the value. In other words, you need unique value attributes within a single select in order to get the behavior you expect. If these values are being used in a macro, one way you could make them unique would be to use roll labels: value="1d6 [Bâton]" , for example.