NumberField represented by checkboxes

Hello, I'm developping a system in V12 with AppV2 and for the character sheet i'm trying to do a numberField that can be set by checkboxes (I'm trying to have multiple icons represent the 5 levels, representing how much you stacked already) Is there a way to do it already with foundry system ? formGroup only provide an input for numberField. I saw that you could override the inputs, but what would be the proper way to make each checkbox set the value to a certain value? Should i make some sort of actions and then pass parameter to it and make it the one that alter the value ?
2 Replies
Farling
Farling3w ago
Doesn't checkbox support allow a value to be set as an attribute which will be assigned as the field value when clicked?
Aaron
Aaron2w ago
I use this in my handlebars for checkboxes
<div class="form-group">
<label>USEWEAPON</label>
<input type="checkbox" name="system.USEWEAPON" {{checked system.USEWEAPON}} data-dtype="Boolean"/>
</div>
<div class="form-group">
<label>USEWEAPON</label>
<input type="checkbox" name="system.USEWEAPON" {{checked system.USEWEAPON}} data-dtype="Boolean"/>
</div>

Did you find this page helpful?