checking the status of checkboxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kate

    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


  • jsWalter

    #2
    Re: checking the status of checkboxes


    "Kate" <anon@anon.ne t> wrote in message
    news:B7Qoc.3107 $wI4.297149@war ds.force9.net.. .[color=blue]
    > 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??[/color]


    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...

    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


    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


    Comment

    Working...