Hi. I'm making my first sheet. This one is for a D&D Battle System game. I have a button on the character sheet that I want players to click on to calculate the number of troops on a token or a sheet (I would prefer to learn how to do both). I got the dice roll work as a roll displayed in chat. It's the updating of the attr_troops that I'm struggling with. Any help is appreciated.
<b>Unit Size:</b>
<select name="attr_unit_size" class="sheet-wide">
<option value="250d6+1000">Infantry (small) 250d6+1000</option>
<option value="200d6+800">Infantry (medium) 200d6+800</option>
<option value="100d6+400">Infantry (large) 100d6+400</option>
<option value="100d6+400">Cavalry (mounted) 100d6+400</option>
<option value="100d4+100">Light Enigines 100d4+100</option>
<option value="20d6+80">Medium Engines 20d6+80</option>
<option value="10d6+40">Heavy Engines 10d6+40</option>
<option value="50d4+100">Canon 100d4+100</option>
<option value="100d20">Special Forces 100d20</option>
<option value="50d6+200">Monsters (Huge) 50d6+200</option>
<option value="50d4+44">Monsters (Gargantuan) 50d4+44</option>
<option value="100d10">Special Forces</option>
</select>
<b>Total Troops:</b><input type="text" name="attr_troops">" <b>Calculate number of Troops</b><button type="roll" name="Generate Troops" value="&{template:default} {{name=Generate Troops }} {{Selected|attr_troops=[[@{unit_size}]] }}>"> </button><br />