Re: [PHP] Checkboxe problem
just use iseet(); if(isset($private)){ //do stuff } - Original Message - From: "Gaylen Fraley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 05, 2002 8:41 PM Subject: [PHP] Checkboxe problem > I have a form with 1 checkbox and have coded it like this: > > > > When the form is submitted, $HTTP_POST_VARS[private] only exists IF checkbox > is checked. It doesn't exist otherwise, which is causing a problem because > there are several other elements before and after. What happens is the > value AFTER "private" is actually populating "private" if "private" is empty > (not checked). I am, no doubt, missing something small, but critical here. > Can someone point out the error of my ways and explain how to get the > checkbox key/value pair into the post vars array when the value is not > checked? > > TIA, > > -- > Gaylen > PHP KISGB v3.22 Guest Book http://www.gaylenandmargie.com/phpwebsite/ > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Checkboxe problem
There is no way. How would you then know if the checkbox was checked or not? I use 'em like this and then check if $private is "myValue" or not. If you really have to get some data thru, use hidden inputs. Niklas -Original Message- From: Gaylen Fraley [mailto:[EMAIL PROTECTED]] Sent: 6. helmikuuta 2002 6:41 To: [EMAIL PROTECTED] Subject: [PHP] Checkboxe problem I have a form with 1 checkbox and have coded it like this: When the form is submitted, $HTTP_POST_VARS[private] only exists IF checkbox is checked. It doesn't exist otherwise, which is causing a problem because there are several other elements before and after. What happens is the value AFTER "private" is actually populating "private" if "private" is empty (not checked). I am, no doubt, missing something small, but critical here. Can someone point out the error of my ways and explain how to get the checkbox key/value pair into the post vars array when the value is not checked? TIA, -- Gaylen PHP KISGB v3.22 Guest Book http://www.gaylenandmargie.com/phpwebsite/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php