Click to See Complete Forum and Search --> : checkbox


bunny1
03-09-2007, 09:26 AM
Hi

I have a page that has a bunch of check boxes with different names.
Once the user presses the submit button another page opens.
In that page i am trying to write code to check which check boxes are checked on the previous page and add their names to an array.

How can i check the checkboxes from another page?
I have to do it on another page as i am waiting for the submit action to know what boxes have been checked.

Hope this makes some sense!
Any help would be appreciated!

Thanks

jasonahoule
03-09-2007, 10:00 AM
You can loop through them i.e.

for($i=0; $i<count($_POST); $i++) {
if($_POST[$i]) {
// do whatever you are trying to do here
}
}

One thing I just thought of is that this will also work for the submit button so you may want to check for that too.

bunny1
03-09-2007, 10:07 AM
great thanks.that's really helpful!