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

Linking the results of an attribute to the display of a drop-down

1674232282
Chris Jones
Pro
Sheet Author
Afternoon. I'm sure this is doable, but could I link which row is displayed from this drop-down to the amount of dots linked in the Radio buttons above? If so, could i do the same across multiple drop-downs, and have them all trigger based on what rating is selected?
1674232323
Chris Jones
Pro
Sheet Author
1674241666
GiGs
Pro
Sheet Author
API Scripter
You can do this at design type. by setting selected, like so: <option value="whatever" selected> For sheets that are in use, the only way to do this is by changing the current value.
1674243973
Chris Jones
Pro
Sheet Author
Where you've put "whatever" there, would I replace that with the attr_ name of the radio button section?
1674246069

Edited 1674246079
GiGs
Pro
Sheet Author
API Scripter
Option values don't start with attr_ (that goes on select at the start), but otherwise yes. See the select example on this page: <a href="https://cybersphere.me/choosing-from-a-list-select-datalist/" rel="nofollow">https://cybersphere.me/choosing-from-a-list-select-datalist/</a>
1674252610
Chris Jones
Pro
Sheet Author
OK, I think I understand. Each element has the same attribute name, and then when I align the values, changing one will automatically change the other. Is that right?
1674254877
GiGs
Pro
Sheet Author
API Scripter
If you have a select, it has one value, and you set that value by selecting a dropdown option.
1674255576

Edited 1674255636
GiGs
Pro
Sheet Author
API Scripter
I just realised you asked about the radio button. there's a couple of ways you can do that. (I've been talking about the select, only.) Set the option values to your select dropdown to equal the possible values of the radio button. Then do one of the following: make the radio button and select value use the same name (the name="attr_whatever" part) - they can be the same, even though the HTML elements are not the same (radio and select). Have a sheet worker that detects wehnever the selet changes, and saves its value to the radio button
1674257209
Chris Jones
Pro
Sheet Author
Brilliant - works a treat, snd it's so simple! One final question, is there a way to have pre-entrred text from the html wrap within a text box? At the moment, the longer strings are just continuing outside of view, even though the box is high enough to hold the text.
1674262093

Edited 1674262336
GiGs
Pro
Sheet Author
API Scripter
if you want to wrap text in a text box, its best to use a textarea. inputs are single line only, and textareas multiple lines. You can also make the input wider, if that helps.
1674287971
Chris Jones
Pro
Sheet Author
Perfect. Thanks again!