THE OTHER WAY
Now if you are planning on having the checkboxes do insert and update at in the same logic, this will require a few hack.
-
The key here is Your API action will have be just a update step to kill two birds with one stone instead of doing a separate insert and update.
-
You will have to have each fields in your database for each separate checkbox (This is because we want to simplify things by just using true or false at the checkbox level on the front vs sending the actual displayed value users are checking the box for. For example (stolz) will only send back a value of true if checked or false if not checked. Then in API action on the backend we will write a condition to check if true returns from the form POST then update the database field to (stolz) or if false update field to “” or whatever make sense to you). This is idea here for having each checkbox values getting their own fields in the database table.
-
On the form you are going to have a checkbox form group for each checkbox value being displayed, so (stolz is going to have it own checkbox form group), (dankbar is going to have it own checkbox form group) so fourth and so on . Within that checkbox form group you will have the checkbox input itself and two other hidden text input.
Here are the steps for setting up Checkbox Group and Checkbox Control
In the CHECBOX GROUP PROPERTIES
for the “value” bind the server connect data thats querying the table from the database and make sure to add .split(’,’) at the end. So, for example if your server connect name is checkedboxdata it will be something like checkedboxdata.data.somefieldname.split(’,’). Doing this will allow us to populate the checkbox input.
Checkbox Control
Now, give the checkbox input “ID” a name like stolz_checkbox and a Static Value of true.
Next we need to add two text input under the checkbox input and make the “Type” hidden
you can give one of the text input a “ID” name of inpt_whenchecked and “Name” stolz_value. This is the hidden input that we will send back on form submit for this specific checkbox form group thats targeting the stolz checkbox input and its label. We will also give this text input a DYNAMIC ATTRIBUTES value and bind it with the Checkbox input value when checked. So, the DYNAMIC ATTRIBUTE value should look like this stolz_checkbox.checked.
Next we will do the same for the second text input. We will give it a "ID’ name of inpt_stolz_checkbox_returnedvalue, and a Type of hidden. We will also give it a DYNAMIC ATTRIBUTES value bind to checkedboxdata.data.somefieldname, do not add .split(’,’).
Next go back to the checkbox input and add a DYNAMIC ATTRIBUTES Checked and for the value pick the value coming from the text input “ID” name inpt_stolz_checkbox_returnedvalue. The Checked value should look like this: inpt_stolz_checkbox_returnedvalue==‘stolz’. doing this will allow the checkbox to be checked when the condition is true.
Do this for all the checkbox groups that you want to send update for.
Backend
As for the $_POST values, set up set values that point to each $_POST and use Conditional>> Contains>> Then, this condition checks for the value true or false upon form submitted and base on which is sent it will send the given info to your database. Do the condition like so:
…
If This is not so clear feel free to message me directly and I can walk you through the steps.