Jump to content

generating a FAIL message


phppup

Recommended Posts

I am using this code to evaluate whether checkboxes within a group have been selected:

    
    function IsChecked($chkname,$value)
    {
        if(!empty($_POST[$chkname]))
        {
            foreach($_POST[$chkname] as $chkval)
            {
                if($chkval == $value)
                {
                    return true;
                }
            }
        }
        return false;
    }

Now, I've decided that I want to add a message upon finding NO SELECTED checkbox items, but it is not functioning as desired.

 if(empty($_POST[$chkname]))
	  {
	    echo("You didn't select any checkboxes.");        
        }

How can I get this or something similar to trigger?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.