RE: [PEAR] QF: checkbox element

From: Date: Mon, 20 Oct 2003 15:23:09 +0000
Subject: RE: [PEAR] QF: checkbox element
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8496@lists.php.net to get a copy of this message
> -----Original Message----- > From: Bertrand Mansion [mailto:bmansion@mamasam.com] > Sent: 20 October 2003 12:07 > > > <mikeatwork@ukonline.co.uk> wrote : > > > However the values being stored in the quickform controller > container > > are: [0]=> string(1) "1" [1]=> string(1) "1" [2]=> > > string(1) "1" > > > > The above array key is going up numerically, so how does it > know which > > checkbox should be checked? Should the array key not be > linked to the > > input s "name" attribute? Ie ["123"] => string(1) "1" ? > > > > Also note that I set the checkboxes label to null, yet in > the HTML I > > still get the <label></label> tags; is there a way to prevent this > > additional mess in the HTML code? > > > > I checked through the QF checkbox.php code, and also had a > peek at the > > advanced checkbox, but couldn't see an immediate solution > to either of > > my problems. > > > > Any ideas? > > This is probably related to the way array_merge works. If > your keys are numeric, they will be reordered starting at > index 0. I don't like this behaviour neither but it seems > there's nothing we can do about it and that's the way it's > expected to work :( > > You could solve this by prefixing your problems code with a > letter in order to make array_merge understand it's a string. That did the job. Thanks. Any idea about the empty <label> html being generated? Regards, Mike c. ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________

« previous php.pear.general (#8496) next »