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

Input Checkbox for updating number field without using JS

I tried to search for this in the forum to see whether anyone else had this problem, but I couldn't really find it within the first 20+ threads so I'm opening a new one. If there is an existing one, please point me to it. The issue is the following (it's AD&D 2E related): I am trying to create one basic AC field that will have a set number based on a field in the armor section (which I already finished). So I made an Armor section, a Shield section and third one for other sources that might modify the AC. Now what I wanted to do is create a read-only number field that updates the value in the total AC number box based on the checked checkboxes below, the options being: Armor, Shield, Modifier, Surprised, Rear, Prone, all the possible Cover variations, ENC variations, ... You see what I'm trying to do here, right? Is there any way to do this without using JavaScript?
1461617795

Edited 1461618058
vÍnce
Pro
Sheet Author
As long as you assign a number value to an attribute, you can have another attribute "auto-calculate" a total derived from other attributes.  It will adjust when any of the values in it's calculation changes.  For example(includes a few different input types) AC:<input type="number" name="attr_ac-base" value="10" disabled/> Foo1:<input type="number" name="attr_foo1" value="1" /> Foo2:<checkbox type="number" name="attr_foo2" value="2" /> Foo3:<select name="attr_foo3"> <option value="0">None</option> <option value="-3">less 3</option> </select> Total AC:<input type="number" name="attr_ac" value="( @{ac-base} + @{foo1} + @{foo2} + @{foo3} )" disabled /> Hope this helps. Cheers
Thank you so much! This is exactly what I needed! I completely derped and forgot about "select/option" ...