Results 1 to 9 of 9

Thread: how do I deal with option boxes

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    87

    Unhappy how do I deal with option boxes

    how do I deal with option boxes

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    what do you mean how do you deal with them. they are a 1 or a 0 and then if they are a 1 you have the value of that checkbox.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    87
    I know that but I need a way how to check if theyr value is 1 or 0

    can u plz give me some sample code


    ?

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    PHP Code:
    if ($_POST['checkbox_name']){
        echo 
    $_POST['checkbox_name']; // echos the value


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    87
    i do that but i have error looooooooook


    PHP Code:
    if ($_POST['V1']) {
        echo 
    "v1"

    }else{

    echo 
    "v2"


  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    It'd help to know what error you're getting. I don't see anything wrong with that code. Are you sure the line number matches up with that if statement?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    87
    also it show v2

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    87
    Loooooooooook



    clicl here please

  9. #9
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    that code own't work like that. you have to have it submitted in a form. can't jsut echo it out and expect it to run right.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width