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

Calculating A Value In Character Sheet

Working on a new character sheet.  I am trying to set a value using a checkbox as a switch, but I can't get it to work. Here is the relevant code with the checkbox and input box. <span class="sheet-table-data-skills"><input type='checkbox' name='attr_isprofskill' value='0' /></span> <span class="sheet-table-data-skills"><input type="text" name="attr_animalhandling1catbonus" title="animalhandling1catbonus (Professional Bonus)" value="@{isprofskill}*{@{animalhandling1ranks},{30}}kh1}" disabled="true"></span> Specifically the part I would like to calculate out is  value="@{isprofskill}*{@{animalhandling1ranks},{30}}kh1}" Where isprofskill is either 1 if the checkbox is checked and 0 if not times the lesser of the number of skill ranks or 30 
1544590110

Edited 1544590375
GiGs
Pro
Sheet Author
API Scripter
the checkbox value should be 1. When a checkbox is unchecked, it always   equals 0. When it is checked, it takes the value listed in the value= tag. So in your version, it is 0 when unchecked, and also 0 when checked.  Unrelated, I'd dump all those spans, and the title parameter isnt all that useful on roll20, so I'd rewrite those as: <input type='checkbox' class="sheet-table-data-skills" name='attr_isprofskill' value='1'  /> <input type="number" class="sheet-table-data-skills" name="attr_animalhandling1catbonus" value="@{isprofskill}*{@{animalhandling1ranks},{30}}kh1}" disabled="true"> The important thing is changing the value to 0 anyway. Is that formula supposed to be a keep highest value? Any animal handling ranks below 30 will be 30. Edit:  also the input type should be "number".
You are right - it should be kl1 not keep highest.  Thanks