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

HTML, how to pick up the value of an option chose in a repeated selection.

1436883574

Edited 1436883635
Hi all, I have another problem, In my Character sheet, I want that when the player choose a talent/feat, with a specific bonus, it applies directly on their attribute, for example the feat "Jumper" will give a +2 in acrobatics and in Dance. I did not find how to do it ! Here is a part of my HTML <fieldset class="repeating_talents"> <select name="attr_bonus" class="bonus" style="width: 820px" > <option value="@{talent1}">Acrobatique -(Athlétique):... +2 en Acrobaties & Danse.</option> <option value="@{talent2}">Agressif:... +1 en Initiative. </option> <option value="@{talent3}">Amis des Animaux -(Empathique):... +2 en Équitation, +2 aux tests de Moral contre les Animaux.</option> </select> </fieldset> <input type="hidden" name="attr_talent1" value="2" /> <!--Acrobatique -(Athlétique):... +2 en Acrobaties & Danse.--> <input type="hidden" name="attr_talent2" value="1" /> <!--Agressif:... +1 en Initiative. --> <input type="hidden" name="attr_talent3" value="2" /> <!--Amis des Animaux -(Empathique):... +2 en Équitation, +2 aux tests de Moral contre les Animaux.--> <input type="number" name"attr_Acrobaties" value="@{othervalues}+@{talent1} /> I also tried to put @{repeating_talents_0_bonus}, it's taking the value, but if I delete the feat or choose another from the select field, it doesn't change anything, it'll all time be taken in the formula. So how to pick up the value of an option chosen in a repeated selection and only when it's chosen ? If you understand my poor english, that would be helpful ! Thank you !
1436892212
Finderski
Plus
Sheet Author
Compendium Curator
Unfortunately repeating sections are somewhat problematic at current. They don't function like other fields and so it's tricky to do things with them in fields outside of the repeating section. If you have any votes for suggestions left, I recommend you throw some support this way , where we are requesting better support for repeating sections in the character sheets.
Mmmh... Another question, is it possible to sum all current values of a repeating fieldset in an disabled input ? By taking all the "repeating_..._X_..." ?
1437216752

Edited 1437216815
Coal Powered Puppet
Pro
Sheet Author
Only if those fields exist. If the field doesn't exist, the program can't add it in (including zero). Now, somewhere on these forums some on put together a method for using repeating fields to count (or something), but I'm not sure where. Edit : API may be able to handle this.
1437239809
vÍnce
Pro
Sheet Author
Counting items in repeating fields Not sure if this will for this use case, but I like the trick and I've been meaning to use it...
Vince said: Counting items in repeating fields Not sure if this will for this use case, but I like the trick and I've been meaning to use it... There you go. That's what I was looking for. Thanks for the link!
Hey thanks, but can you help me again ? Because I did not understand it very clearly, I put : .sheet-repeating-fields { counter-reset: sheet-rep-items; } In the CSS.. But then... What do I do ? What does the "counter-reset: sheet-rep-items;" ?
1437311874
Lithl
Pro
Sheet Author
API Scripter
The counter-reset property expects at least one name, and optionally a value for each name given. The name doesn't need to relate to anything else on your sheet, in actuality, it's simply something to identify your counter by. counter-reset will reset the named counter to the given value, or to 0 if no value is given. You can access the value of the counter with the counter() function. Pass the name of your counter to the counter() function, and the value returned will be the current value of the counter. This is generally useful with the content property. In order to make the counter behave like it's counting, you need to increment it. Generally, the counter is incremented each time it appears by using the counter-increment property in the same selector that the counter function is used. More on using counters .