Ok, so I have a form with lots of checkboxes, all the same name, and different values.
Here's a small sample for later clarity.
<input type = "checkbox" name="var_id" value=7><b>BD2506</b> -- How blah<br>
<input type = "checkbox" name="var_id" value=9><b>BD18</b> -- How blah2<br>
<input type = "checkbox" name="var_id" value=11><b>BD16</b> -- What blah3<br>
Now, they're named the same thing for a good reason, they're all the same thing... and more importantly the form is dynamically generated, and dealing with it that way just makes more sense, assuming I can do what I want to do.
And that is simply, get the list of checked boxes... I could've sworn I did this, but now when I run my code it's not working. Is there an array or some value (I'm using POST but willing to use GET if need be) which is holding 7,9 & 11 when they're all checked? If I just try to use $HTTP_POST_VARS["var_id"] I only get 11.
I thought I could set that to a variable say $temp, then count($temp) for the number of boxes checked, but that's not working... I figure if I need to do a workaround, I can have javascript tally up all the checked boxes and set a string equal to that list, but I'm preferring a direct approach to a workaround if one exists.
Thanks much,
-Rob
Here's a small sample for later clarity.
<input type = "checkbox" name="var_id" value=7><b>BD2506</b> -- How blah<br>
<input type = "checkbox" name="var_id" value=9><b>BD18</b> -- How blah2<br>
<input type = "checkbox" name="var_id" value=11><b>BD16</b> -- What blah3<br>
Now, they're named the same thing for a good reason, they're all the same thing... and more importantly the form is dynamically generated, and dealing with it that way just makes more sense, assuming I can do what I want to do.
And that is simply, get the list of checked boxes... I could've sworn I did this, but now when I run my code it's not working. Is there an array or some value (I'm using POST but willing to use GET if need be) which is holding 7,9 & 11 when they're all checked? If I just try to use $HTTP_POST_VARS["var_id"] I only get 11.
I thought I could set that to a variable say $temp, then count($temp) for the number of boxes checked, but that's not working... I figure if I need to do a workaround, I can have javascript tally up all the checked boxes and set a string equal to that list, but I'm preferring a direct approach to a workaround if one exists.
Thanks much,
-Rob