Re: [PHP] Checkbox Initial Value based on record in db

2002-05-01 Thread Miguel Cruz

On Wed, 1 May 2002, Daniel Negron/KBE wrote:
 Kinda off topic here, just checking to see If I am on the right track with
 this
 
 input type=checkbox name=abb value=?php echo $myrow['abb'] ?
 
 the result should be :
 
 IF the record contains the field abb and it has a value of 1 then it will
 be checked off for viewing.

http://www.w3.org/TR/REC-html32#fields

input type=checkbox name=abb value=1 checked
input type=checkbox name=abb value=1

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Checkbox Initial Value based on record in db

2002-05-01 Thread 1LT John W. Holmes

It will only be checked if you put CHECKED in your HTML.

if($myrow['abb'] == 1) { echo  checked ; }

Add that into your input element.

---John Holmes...

- Original Message -
From: Daniel Negron/KBE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 01, 2002 1:04 PM
Subject: [PHP] Checkbox Initial Value based on record in db


Kinda off topic here, just checking to see If I am on the right track with
this

input type=checkbox name=abb value=?php echo $myrow['abb'] ?

the result should be :

IF the record contains the field abb and it has a value of 1 then it will
be checked off for viewing.

Brainfarting all day !!


Thank You



Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com




--
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] Checkbox Initial Value based on record in db

2002-05-01 Thread Craig Vincent

 Kinda off topic here, just checking to see If I am on the right track with
 this

 input type=checkbox name=abb value=?php echo $myrow['abb'] ?

 the result should be :

 IF the record contains the field abb and it has a value of 1
 then it will
 be checked off for viewing.

No, that wouldn't workto have a checkbox autochecked the HTML must be
similar to

input type=checkbox name=abb value=?php echo $myrow['abb']; ?
checked

So a sample coding might be

input type=checkbox name=abb value=?php echo $myrow['abb']; ? ?php
if ($myrow['abb']) { echo 'checked'; } ?

Sincerely,

Craig Vincent



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php