Welcome Guest, Not a member yet? Register   Sign In
set_checkbox() keeping checked state problem
#2

[eluser]obiron2[/eluser]
I think you have fallen foul of the $_POST gotcha. If a checkbox is not checked, then it is NOT returned as part of the $_POST array. You may need to ensure that all of your checkboxes have distinct names (i.e. you can't use test[] as the position in the array will change based on the number of boxes that were checked on submission. you need to give them names test_01 test_02 etc..) When validating for them you need to check them using isset() rather than the value. This means that you also need to keep an array of all the 'possible' checkboxes so that you can iterate that array to run the isset() on each one.



Messages In This Thread
set_checkbox() keeping checked state problem - by El Forum - 05-07-2013, 04:08 PM
set_checkbox() keeping checked state problem - by El Forum - 05-08-2013, 04:51 AM
set_checkbox() keeping checked state problem - by El Forum - 05-08-2013, 05:45 AM
set_checkbox() keeping checked state problem - by El Forum - 05-08-2013, 09:32 AM
set_checkbox() keeping checked state problem - by El Forum - 05-08-2013, 04:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB