Checkbox how to handle in update form

Oh that is nice didn’t know that.

I did not understand how to deal with Wappler, but I moved the </ div> to the end of the checkboxes and included them all
Ok now I try if it works. Then I will let you know

after many attempts I discovered why the page did not work
Wappler haves problems with database record field with name start is a number (Example 12_dic_2018) while it works regularly with (example dic_2018_12)

Hi, I have boolean value in the database, i wanted to list that value with checkbox in repeated region, i tried your way, Like i have placed the checkbox group and then inside i have created checkbox. both inside a table cell. and then assigned 1 to static value, group i have choosen the database value from my list action. But it didn’t binded. is there any mistake i do ? please help me…, I feel if there is video showing your way that be great.

With Boolean field use directly a checkbox, no checkbox group.
Then select the checkbox, add dynamic attribute > checked > and for value select your binding.

Checkbox groups expect array, and should be used for multiple checkboxes inside.

It worked nicely… thanks Teodor.

1 Like

Sorry to bring this post back up.

I’ve followed this and I’ve got my checkbox in a checkbox group (only 1 checkbox) and it’s dynamically checking or not checking based on database value (0 for unchecked, 1 for checked) but for the life of me I can’t get it to submit through the form, am I meant to $_POST the checkbox group or the checkbox itself? It’s just not updating the record in the database.

As Teodor mentioned, “Checkbox groups expect array and should be used for multiple checkboxes inside”.

You don’t need to use checkbox group since you are only using a single checkbox.
Without the checkbox group, you just pass the checkbox’s value to your POST variable. From what I have observed, if the checkbox is unchecked (false), it will not pass any value. If it is checked, it will pass “true”. So it is nice to have a default value in your Update Query.

Hope this helps.

Hi Teodor,

Can you please help, what part i am missing. whiling doing at check box group level, check boxes are not getting checked, whe i do on check box level all gets checked.




Where do you need to use a checkbox group here?
From what I see you just need a single checkbox in each row, no need of a checkbox group.

yes i need one check box for one row, but table is bootstrap4 so i added in one cell it populates. my aides is to show check box for User status filed which is currently showing 1,1,0,0 to show user is active or not

So what’s the problem? Can you explain what is wrong?

my database is values 1,1,0,0 for 4 users means 2 are active and two are non active. but when i link my dynamic values to check box group as value, nothing happens. but when i select checkbox (not group) and assign checked attribute, all check boxes are checked when with zero from database record. in below screenshot i am expecting first 2 rows to be checked and rest 2 to be not checked as boolean value is 0. Please support

Your expression selected in the ‘checked’ condition is wrong.
You should pick it under the repeater in the data picker, not under the server connect component.

1 Like

Thanks a lot. its working now

1 Like

Thank you Patrick. Your post just helped me solve a problem I’ve been working on for over a day.