Re: Re: Handling checkboxes that aren't checked!!!

From: Date: Tue, 04 Nov 2003 23:11:29 +0000
Subject: Re: Re: Handling checkboxes that aren't checked!!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-168516@lists.php.net to get a copy of this message
>> I have a page with a Form and a Checkbox. >> >> I have a second page which wants to do something depending on if the >> checkbox is selected or not. >> If its selected there is no problem. But if I tryand do anything if >> it isn't selected then it says the variable is 'undefined'. How can I >> test For checkbox's I like to have a HIDDEN checkbox. <INPUT TYPE=hidden NAME=blah VALUE=""> <INPUT TYPE=checkbox NAME=blah VALUE="1"> <INPUT TYPE=checkbox NAME=blah VALUE="2"> <INPUT TYPE=checkbox NAME=blah VALUE="3"> With the hidden name and value, I'll always have at least a blank form variable passed. Daniel

« previous php.general (#168516) next »