470,848 Members | 1,267 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

checking the status of checkboxes

I have an PHP page that contains several checkboxes. I need to know if the
user has check all of the checkboxes before they can proceed to the next
page.
How do I check there status?
And can I put a conditon on a Submit button so that when they press Submit
it will only open the next page if all boxes are checked??

TIA
Kate
Jul 17 '05 #1
1 1775

"Kate" <an**@anon.net> wrote in message
news:B7*******************@wards.force9.net...
I have an PHP page that contains several checkboxes. I need to know if the
user has check all of the checkboxes before they can proceed to the next
page.
How do I check there status?
And can I put a conditon on a Submit button so that when they press Submit
it will only open the next page if all boxes are checked??

OK, sort of talking about 2 different things.

1) verify selection before going to next page.

Since you placed this on the PHP news, I can only assume you are thinking of
this via PHP.

So, yes, you can check the values of checkboxes from PHP, but only after the
form is submitted.

google $_POST and $_GET to see how
2) only submit if all checked

that is a client side operation, and PHP has no control over that.

for this you need client-side Javascript.

and the easiest way to do that is to go get a nice form validation class
from...

http://groups.yahoo.com/group/javascript_validation

all you need to do is add a few custom attributes to the checkbox tags,
include the JS class file and your ready to go.

Hope this helps in some way.

Walter
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by arenaTR | last post: by
2 posts views Thread by Maziar Aflatoun | last post: by
1 post views Thread by Ramakrishnan Nagarajan | last post: by
8 posts views Thread by linuxnooby | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.