Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
11-25-2007, 05:24 AM #1
- Join Date
- Jun 2007
- Thanked 1 Time in 1 Post
Multiple Selections with checkboxes
I need to have a series of options that can be selected with checkboxes. I suspect that in the future I'm going to need to add/delete/modify the number of these checkboxes.
Can you suggest a better method of handling this than adding a field in my DB to match each checkbox on the form? I mean, if I have to change the number of check boxes down the road, I will have to recode the form and add/delete fields from the DB structure. Is there a method for retrieving an array of the checkbox results for example?
ThanksOf all the things I've lost in my life time, my mind is the one I miss the most!
11-25-2007, 06:48 AM #2
you can make one field called checkboxes (or whatever) and fill it with
Then in the php if you save the field in the $str var:Code:one|two|three|four
$checkboxes = explode('|', $str);
echo($checkboxes); // 'one'
echo($checkboxes); // 'four'
Then when you get a new checkbox you can add it on the end of that.
Why not thank me?