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

Attribute-backed span for autocalc value?

I'm trying to combine these two to display a read-only autocalc value in a span. Is this possible, or would I have to calculate with worker scripts? <input type="hidden" name="attr_autovalue" value="@{attr1} + @{attr2}" disabled /> <span name="attr_autovalue"></span> This just results in the text "@{attr1} + @{attr2}" getting displayed, not the calculated value.
1592952761
GiGs
Pro
Sheet Author
API Scripter
Interesting - it looks like attribute-backed spans arent compatible with autocalc fields.  Looks like sheet workers are your only option here.
I figured as much, thanks!
1593091896
Peter B.
Plus
Sheet Author
Primal Zed said: I'm trying to combine these two to display a read-only autocalc value in a span. Is this possible, or would I have to calculate with worker scripts? <input type="hidden" name="attr_autovalue" value="@{attr1} + @{attr2}" disabled /> <span name="attr_autovalue"></span> This just results in the text "@{attr1} + @{attr2}" getting displayed, not the calculated value. If you just want to how the value to the user of the character sheet all you have to do is not hide the input field. <input type="text" name="attr_autovalue" value="@{attr1} + @{attr2}" disabled /> This would show a disabled field with the value calculated together. If a user accesses the value with a macro or the likes then it will return ' @{attr1} + @{attr2} ' If you want the user to be able to acces the calculated value then you can just add square brackets and it should be done. <input type="text" name="attr_autovalue" value="[[(@{attr1})+(@{attr2})]]" disabled /> If your goal can only be achieved with a <span> element, then I cannot help you.