Skip to content
Advertisement

How to get values of dynamic Unchecked checkboxes in post PHP

I have a form with other fields, I have a list of clients in a checkbox array. To get that list I use the database table-field and populate a list. HTML FORM

JavaScript

Now when I submit the form, I need to know which one are unselected, because the form loads with the value selected from the database. I need to update the database table field value to zero(0) for the unselected ones. I am finding a hard time with dynamic checkboxes to do a name value pair or get values of unselected checkboxes as post doesn’t send unselected checkbox values

JavaScript

Advertisement

Answer

How i said in the comment you can use array_diff for select only the value isn’t selected :

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement