Disabled Select drop down checking through PHP

Posted by user541597 on Stack Overflow See other posts from Stack Overflow or by user541597
Published on 2011-01-04T19:51:20Z Indexed on 2011/01/04 19:53 UTC
Read the original article Hit count: 119

Filed under:
|

I have a couple of drop down boxes I access through POST with PHP. When the boxes are disabled and not equal to zero I have the program do something. However when they are disabled I do not want them to do anything. The way I check if the boxes are active is by using an if statement

if ($_POST['box'] != "blank"){

//do something

}

So basically I check if the box is not in the default blank position run the if statement.

However when it is disabled I am not sure how to check or what kind of value it returns if any. What can I add to the if statement so it will not go into the loop when the boxes are disabled?

I tried:

   if ($_POST['box'] != "blank" || $_POST['box'] != ""){

    //do something

    }

But that did not work. Any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about html