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

Problem with auto-calculating field in custom character sheet

Hello, 

I am a complete beginner at HTML and CSS, but been trying my hand at making a character sheet for a game that lacked one. Been going well, but ran into some issues with auto-calculating field. Been trying to consult the wiki and searched here but couldn't find the issue. 

I have in total seven of these named incomeamount1 to 7

<input class="incomeamount" type="number" name="attr_incomeamount1" value="0"/>

They are supposed to be calculated in this thing

<input class="totaleconomy" type="number" name="totalincome2" value="(@{incomeamount1}+@{incomeamount2}+@{incomeamount3} + @{incomeamount4}+@{incomeamount5}+@{incomeamount6}+@{incomeamount7})" disabled="true"/>

I've been staring at this thing for what feels like forever, but can't figure out the issue. 

It looks like this in the game

Any idea on how to solve it? I've read that sheet workers are a better way of doing it, but I know absolutely nothing in terms of javascript. 

January 09 (5 years ago)

Edited January 09 (5 years ago)
vÍnce
Pro
Sheet Author

name="totalincome2"

try

name="attr_totalincome2"

;-)


Vince said:

name="totalincome2"

try

name="attr_totalincome2"

;-)

Wow. When you mention it, it is so obvious. Yet I stared myself blind and didn't notice it.

Many thanks, good sir! It works as intended now :)


January 09 (5 years ago)
Andreas J.
Forum Champion
Sheet Author
Translator

This is the number common mistake made by pretty much everyone at least at some point, and mentioned as one of the common pitfalls while working on character sheets: https://wiki.roll20.net/Building_Character_Sheets#Common_Mistakes