Checkbox Array Value Saved To DB

Thank you all for your help and suggestions. Each had a perspective that ultimately helped me to arrive at a successful end, and I appreciate it very much!

This is what I finally settled on. After playing around with all the differing solutions. I started thinking with logic and finally the following dawned on me:

<div id="inp_school_type" class="form-group col" is="dmx-checkbox-group">

<legend class="pb-2" style="font-size: 16px;">School Type</legend>

<!-- group checkboxes -->

<div class="form-check form-check-inline mr-5">
<input class="form-check-input" type="checkbox" id="inlineCheckboxBoarding" value="Boarding" checked>
<label class="form-check-label" for="inlineCheckboxBoarding">Boarding</label>
</div>
<div class="form-check form-check-inline mr-5">
<input class="form-check-input" type="checkbox" id="inlineCheckboxDay" value="Day" checked>
<label class="form-check-label" for="inlineCheckboxDay">Day</label>
</div>
<div class="form-check form-check-inline mr-0">
<input class="form-check-input" type="checkbox" id="inlineCheckboxNight" value="Night" checked>
<label class="form-check-label" for="inlineCheckboxNight">Night</label>
</div>

<!-- group checkboxes -->

<!-- {{inlineCheckboxBoarding.checked.then('Boarding', '')+' '+inlineCheckboxDay.checked.then('Day', '')+' '+inlineCheckboxNight.checked.then('Night', '')}} -->

</div>

<input type="hidden" name="school_type" dmx-bind:value="(inlineCheckboxBoarding.checked.then('&nbsp;Boarding&nbsp;', '')+' '+inlineCheckboxDay.checked.then('&nbsp;Day&nbsp;', '')+' '+inlineCheckboxNight.checked.then('&nbsp;Night&nbsp;', ''))" id="school_type">

It works perfectly.

1 Like