Hi Wapplers,
I have checkboxes and I am trying to get them to automatically load as being “checked” based on whether they exist in a database query. I have it working when I have the [0] in the query result but only for the first one, obviously. But I am trying to have it so all checkboxes are checked if they exist in the result.
Code is as follows:
<div id="repeat1" is="dmx-repeat" dmx-bind:repeat="searchmodules.data.searchmodulesonefunder.data.query">
<div class="form-check">
<input class="form-check-input" type="checkbox" dmx-bind:id="inputCheckbox[{{$index}}]" name="inputCheckbox[]" dmx-on:checked="addmoduletolist.load({modulename: moduleName, moduleid: module_id})" dmx-on:unchecked="deletemodulelist.load({id: module_id})" dmx-bind:value="moduleName" dmx-bind:checked="searchmymodules.data.query.moduleName.split(',').contains(searchmodules.data.searchmodulesonefunder.data.query.moduleName.split(','))">
<label class="form-check-label" dmx-bind:for="inputCheckbox[{{$index}}]">{{moduleName}}</label>
</div>
</div>