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 and Drag&Drop (again)

1588623221

Edited 1588623462
Abd al Rahman
KS Backer
Sheet Author
API Scripter
Dear community, my  first character sheet is almost done. I just have one issue to solve. I saw a couple of threads dealing with the same issue, but I don't see what I am doing wrong. Other firlds, outside a repeating list, work fine. When I drag a button from a repeating list, I get a button in the macro bar which looks like this: Here is my html code: <button type='roll' value='&{template:default} {{name=@{character_name} würfelt auf @{Fertigkeit2}}} {{Der Wurf ist um [[1d20cs16cs17cs18cs19cs20cf1cf16cf17cf18cf19 + @{FW2} + @{leitE2} + @{Fertigkeitsbonus2} + ?{Bonus|0} -20 ]] besser als 20!}}' name="EW_Fertigkeit"></button> <input type="text" name="attr_Fertigkeit2" value ="Name"/> <span>FW </span><input type="number" name="attr_FW2" value ="1"/> <select name="attr_LeitE2" class="dtype"> <option value="@{LeitSt}" selected="selected">St</option> <option value="@{LeitGe}">Gs</option> <option value="@{LeitGs}">Gw</option> <option value="@{LeitKo}">Ko</option> <option value="@{LeitIn}">In</option> <option value="@{LeitZt}">Zt</option> <option value="@{LeitAu}">Au</option> <option value="@{LeitpA}">pA</option> <option value="@{LeitWk}">Wk</option> </select> <span>Bonus </span><input type="number" name="attr_Fertigkeitsbonus2" value ="0" /> <span>PP </span><input type="number" name="attr_FertPP2" value ="0" /> </fieldset> Any idea what I am doing wrong? Edit:  I forgot to mention, when I press that button, I get this:
1588626269
GiGs
Pro
Sheet Author
API Scripter
You have two problems here: The first is that your button doesnt have a name. It should have something like <button type='roll' name="roll_MYBUTTONNAME" value='snipped for space"></button> The second problem is you value entry starts with a single quote ', but ends with a double quote ". You need top use the same the at the beginning and end. Correcting this should make your button work. You will still get a long name like this on the macro bar: That's because that's the button's actual name. Buttons and attributes in a repeating section have a name that's different from other attributes. It's in three parts: the repeating section name, a row id (that complicated set of letters and numbers in the middle), and the field within the repeating section you likely think of the name. Roll20 needs all 3 bits of information to know which button or attribute in the section you are referring to. You can rightclick the name in the macro bar and rename it.
1588627453
Kraynic
Pro
Sheet Author
There is a name in that code, it is just after the value.  Does the order of value and name matter in the html?
1588627905

Edited 1588627926
GiGs
Pro
Sheet Author
API Scripter
Oh! i missed that. I snipped the value, and that caused me to misread the beginning and end quotes. The order doesn't matter. So forget what I said about the quotes. This is the actual problem: your name looks like this: name="EW_Fertigkeit" but it should be name="roll_EW_Fertigkeit" Roll20 needs to the roll_ prefix to know this is a roll button, and to activate the special properties of roll buttons (like being able to trigger the roll from the macro bar).
1588629547
Abd al Rahman
KS Backer
Sheet Author
API Scripter
Thank you for the fast answer :) I fear it did not work. Here my change.  <button type='roll' name="roll_ew_fertigkeit" value='&{template:default} {{name=@{character_name} würfelt auf @{Fertigkeit}}} {{Der Wurf ist um [[1d20cs16cs17cs18cs19cs20cf1cf16cf17cf18cf19 + @{FW} + @{leitE} + @{Fertigkeitsbonus} + ?{Bonus|0} -20 ]] besser als 20!}}' ></button> I still get this:
1588630977
GiGs
Pro
Sheet Author
API Scripter
Does your repeating section name (the fieldset name) have upper case letters in it? If it does, make them all lower case.
1588632527
Abd al Rahman
KS Backer
Sheet Author
API Scripter
That did the trick! Many thanks!
1588638310
GiGs
Pro
Sheet Author
API Scripter
You're welcome :) I only knew that because of struggling with the same issue for several days!
1588639215
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: Does your repeating section name (the fieldset name) have upper case letters in it? If it does, make them all lower case. *squints and reads the documentation* GiGs said: You're welcome :) I only knew that because of struggling with the same issue for several days! Yeah this doesn't seem to be mentioned <a href="https://wiki.roll20.net/Building_Character_Sheets#Repeating_Sections" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#Repeating_Sections</a> or <a href="https://wiki.roll20.net/Button" rel="nofollow">https://wiki.roll20.net/Button</a> Is this something that breaks buttons specifically, or just a no-no with Repeating section naming? Please add a note about this in the right section.
1588640089
GiGs
Pro
Sheet Author
API Scripter
It breaks buttons specifically, and any scripts that try to access buttons by their name. I discovered it when working on the Universal Chat Menus script. Repeating section names have to be in lower case, otherwise they appear &nbsp;to work for most things, but anything which tries to access the&nbsp; button by name fails.