[eluser]chrisco23[/eluser]
OK, I've definitely spent way too much time and must be missing something obvious here.
I have a long complicated form but the part that is giving me grief is a simple piece.
My page is a long registration page with a half dozen consecutive forms. It's structured like this so I can reuse the forms in "edit mode" later on, one at a time.
I have some data in a mysql db table, from a successful registration, consisting simply of 8 integers that are 0/1 flags.
My form has 8 checkboxes that correspond.
I cannot figure out how to pre-populate the checkboxes. The User Guide explains
repopulating with data that has been posted. I even tried faking by sticking my data into $_POST but still no luck.
Can anyone show how they are using a simple checkbox (this is not even an array of values like the User Guide example) that can be populated with 0 or 1 according to the design of the new Form Validation class?
This same form, with 8 checkboxes, should default to all 8 checked when used in "add mode" (ie. during registration).
I can't do basic old-school logic like: if ($var = 0) echo ' selected="selected"'; ... because that would be incompatible with how I am using set_checkbox() sucessfully in "add mode" (the first time the form is hit).
I hope I explained this right, as it seems like it must be a simple and common thing and I'm missing something here.
Thanks,
Chris