Checkboxes in a form with nested query

Hi,

I’ve managed to create an online form, which posts to an “order” table in the DB (PHP).
I have multiple (dynamic checkboxes) which is a nested repeat that also needs to be inserted into another table “order_package” upon submitting the form. This is linked by pck_id field

I can get the form to insert into the “order” table, but it doesn’t multi insert in the “order_package” table any of the selected check boxes in the form.

Not sure what I am doing wrong?
here is the code of the check boxes in the form

                <div class="col">
                  <div class="form-check">
                    <input class="form-check-input" type="checkbox" dmx-bind:value="pck_id" name="checkboxes[]" dmx-bind:id="'checkbox'+id" dmx-bind:name="pck_id">
                    <label class="form-check-label" for="'checkbox'+id">{{pck_name+' ('+pck_id+')'}}</label>
                  </div>
                  <div class="row" is="dmx-repeat" id="repeat_items" dmx-bind:repeat="list_items">
                    <div class="col">
                      <p>{{itm_description+' (ID '+itm_id+', Pck '+itm_pck_id+')'}}</p>
                    </div>
                  </div>
                </div>
              </div>

Hey @cpuser,

You are inserting…

So I would like to see:

  1. a screenshot of your form rendered on your browser (aspecially the checkboxes part), BEFORE YOU SUBMIT it

  2. Are there any errors in your dev tools?

  3. A screenshot of the record_insert in order to understand how you handle the chockbox values
    I don’t see a dmx-bind:checked attribute on your checkbox, only a value assigned there (the pck_id value)
    You know about the special treatment of checkbox on server side (you need a default value -0)

**I don’t think that you have to assign on the form labels the dynamic id of their inputs… Just the default id that is not included in your checkbox definition

Forgive me if I am wrong…

@famousmag I have managed to insert the checkbox value into a seperate table, however I am getting duplicate entries into the DB table order_packages

image

Please share a screenshot of your record_insert