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

Radio button on repeating section

Hello,  I have a section that can be repeated multiple times, which contain: 1. text field (aspect attribute) 2. dropdown menu (die rate attribute) 3. radio button. (selection attribute) My problem: The radio button is for the player to identify which aspect they want use, but the radio button don't consider the other repeated items. so instead of be able to choose only one aspect, the play can choose several. How can i create a solution where the player pick only aspect? Characters can have any number of aspects, so I cannot hardcode it. thanks in advance  < label > Aspectos </ label > < fieldset class = "repeating_aspectos" > < input name = "attr_aspectos" type = "text" class = "desc" > < select name = "attr_aspecto_dado" class = "select_dice" > < option value = "0" selected > - </ option > < option value = "4" > D4 </ option > < option value = "6" > D6 </ option > < option value = "8" > D8 </ option > < option value = "10" > D10 </ option > < option value = "12" > D12 </ option > </ select > < input type = "radio" value = "1" name = "attr_aspecto_sel" > </ fieldset >
1743658792
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'll need to use a checkbox and sheetworkers to control the values of the attributes in the other rows.
1743680644

Edited 1743990748
GiGs
Pro
Sheet Author
API Scripter
Checkboxes are perfect for only choosing one at a time, as Scott hints at. When someone clicks one checkbox, have a sheet worker detect which one was just checked, and uncheck all of the others. Radio buttons on the other hand probably don't work the way you expect because of the way attribute names work in a repeating section. Radio buttons on different rows of the repeating section are always different radio buttons. They are not connected. You can't have the radio button property of clicking one and unchecking the rest automatically. PS: if you just want to to use the latest aspect chosen, you don't need the checkbox. Just detect the select changed, and the row id it occurred in, then set every other row's aspect to 0. This could run every time an aspect is changed. Alternatively you could use a checkbox to show which item is selected (uncheck all others), so you don't have to delete aspect details n other rows.
1745092981
GiGs
Pro
Sheet Author
API Scripter
I finally got around to writing a post about this, explaining why this happens and giving a complete solution: <a href="https://cybersphere.me/radio-buttons-in-a-repeating-section/" rel="nofollow">https://cybersphere.me/radio-buttons-in-a-repeating-section/</a>