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

Calculated Fields

1417085328
Finderski
Pro
Sheet Author
Compendium Curator
While the documentation page for character sheets doesn't state that calculated fields is exclusive to input types="numbered" I'm guessing that's the limitation? If it's not, how would you get a calculation to work with an input type="text"? I tried and couldn't get it to work.
1417105672
Diana P
Pro
Sheet Author
From my testing, the thing to get calculated fields to work is they need to have disabled="true". <input class="sheet-inputbox" type="text" name="attr_strmodmab" title="strmodmab" value="floor(@{str}/2-5)" disabled="true"> works for me. I tend to use text input almost exclusively because I don't like the arrows that the number inputs have. :)
1417115884
Finderski
Pro
Sheet Author
Compendium Curator
Hmmm...weird. I thought I tried that, but maybe not. But I agree with you, I'm not a huge fan of the arrows myself. :) Thanks.
1417224936
Lithl
Pro
Sheet Author
API Scripter
Diana is correct, the only requirement for a calculated field is that it's disabled (although I don't believe it works for select or textarea fields, just input). However, if you want number fields but no arrows, you can remove the spinner arrows: input[type=number] { -moz-appearance: textfield; } input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; } This should work for Firefox and webkit browsers (such as Chrome). I don't believe there is any solution for IE or Opera, though