I have looked through stackoverflow and can't seem to find exactly what i am looking .I am trying to figure this out and have spent a few hours on it so far.
I have database results being outputted and producing boxes with text in via a foreach and in the foreach statement there is the following code to build an array for print_select. I need the checkbox selections to remain if there are errors with my form and someone then goes back to the intial page where the checkboxes are (I have all the form and errors part done).
This is the html I have:
<input type=\"checkbox\" name=\"print_select[]\" value=\"{$value['id']}\">
The {$value['id']} represents numeric values and each one is different.
Now had this been a simple name="something" I could have just set it to selected after the page reloaded with some php but this uses an array which makes it slightly tricky for me.
Has anyone been able to keep checkbox selections after post when its using an array? I am probably missing something really simple but thought it was worth asking here aswell.