BenjiWentBananas
BenjiWentBananas
LOELeague of Extraordinary FoundryVTT Developers
Created by BenjiWentBananas on 8/30/2024 in #system-development
data from onchange event
Hey quick question, i feel like an idiot. I'm used to angular as a framework, and handlebars obviously is much more toned down compared to it, so I can't seem to figure out the correct way to do this: I have a couple checkboxes representing a numeric value, so if i check the third checkbox, the value is set to three. If I check the second checkbox, the value is set to two, ecc. How do I apply a value to the individual checkboxes that is included in the event object passed to the onchange event? I imagine it'd look like something along these lines:
<checkbox class="test" data=1>
<checkbox class="test" data=2>
<checkbox class="test" data=1>
<checkbox class="test" data=2>
we click checkbox 2 and inside the .js we got something like:
html.find(".test").change((event) => {
actor.system.data = event.data
});
html.find(".test").change((event) => {
actor.system.data = event.data
});
Is this actually doable like i think it is, or am I too spoiled by other frameworks? Any answer is appreciated:chefkiss:
11 replies