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

Do auto calc in repeating fields?

June 10 (10 years ago)

Edited June 10 (10 years ago)
DXWarlock
Sheet Author
API Scripter
Is it possible to do autocalc in repeating fields?
For a simple example:
<fieldset class="repeating_OCCSK">
	<input type="number" name="attr_OCCB" value=0>
	<input type="number" name="attr_OCCPL" value=0>
	<input type="number" name="attr_OCCT" value="@{OCCB}+(@{OCCPL}*@{LEVEL})" disabled="true">
</fieldset>


I'm attempting to calculate their total skill percentage for them so when they change levels, they don't have to go in and edit 50+ text boxes they can just change the level and they all update.

..since its always
base + (per level * level).
or to use the actual attributes:
OCCB + (OCCPL * LEVEL)

But I'm not sure if this is possible with the limitations of repeating fieldset, or if it is, how to call the values from that same fieldset..since they are appended with _1 etc when created.
June 10 (10 years ago)
Sam M.
Pro
Sheet Author
You can't autocalculate total values from multiple fieldset rows into one field.
June 10 (10 years ago)

Edited June 10 (10 years ago)
DXWarlock
Sheet Author
API Scripter
Unless Im misunderstanding what your saying, I only need to do it for each row. not pull values from other ones.
Just do it inside each 'added' row with its own values it has
June 10 (10 years ago)
Sam M.
Pro
Sheet Author
Oh, then in that case you can do it the way you're describing it. The system automagically looks for that field within a fieldset first then it looks for it outside of the fieldset.
June 10 (10 years ago)
DXWarlock
Sheet Author
API Scripter
well shucks, its working now..I tried for a while and just got the calc formula in hte box.
Maybe I had one set at text, and not number, not sure now I redid it so many times..