Re: Forms...

From: Date: Wed, 09 Mar 2005 19:37:36 +0000
Subject: Re: Forms...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38833@lists.php.net to get a copy of this message
Bastien Koert wrote:
I use this format <input name="right_eye" type="checkbox" value="1" <? if ($rows['right_eye']==1) { echo " CHECKED "; } ?>>&nbsp;Right Eye(s)
if your into XHTML: <input name="right_eye" type="checkbox" value="1" checked="checked" value="1" /> (Bastien already showed how to dynamically determine whether the chkbox is checked :-) ... all attribs in lower case, and every one must have a value set, in the case of the 'checked' attrib the value is 'checked'. I haven't tried it out but I assume the following html would result in an unchecked box - I also imagine that that may depend on the DOCTYPE of the output page - and I may just be plain wrong :). <input name="right_eye" type="checkbox" value="1" checked="" value="1" />
Bastien
From: Mark Benson <markbenson@mac.com> To: php-db@lists.php.net Subject: [PHP-DB] Forms... Date: Wed, 9 Mar 2005 19:12:31 +0000 Does anyone know if it is possible to have 'checkbox' elements in a form appear 'checked' or 'unchecked' when a page loads data from a MySQL data source? Can I use an attribute in the <input> tag to switch that? -- Mark Benson AIM - SilValleyPirate MSN - mark.benson@hot-toast.com Visit FlatPackMacs online: <http://fpm.68kmac.com> Visit my Homepage: <http://homepage.mac.com/markbenson> "Introducing Macintosh Classic II - pick one out on your way past the trash!" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#38833) next »