Checkbox in PHP form

Checkbox in PHP form

am 09.11.2009 02:39:40 von Ernie Kemp

------=_NextPart_000_000A_01CA60B3.9972CAD0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_000B_01CA60B3.9972F1E0"


------=_NextPart_001_000B_01CA60B3.9972F1E0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit



Need some help here with checkboxes in an html form.



My issue is I have a form that needs to be viewed with checkboxes filled in
depending on the values in the table.



I tried:

echo "checked=yes"; } else { echo ''; } ?> value="PFDs"
name=f_sequipment1>PFDs

but the checkbox field is always checked.



I thought of JavaScript also but it would have to be a "if $row[33] then run
a JavaScript function" . This is not working for me neither.



Sorry if this seems trivial but I need your help.



Thanks in advance.....










------=_NextPart_001_000B_01CA60B3.9972F1E0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">



charset=3Dus-ascii">





lang=3DEN-CA
link=3D"#996600" vlink=3D"#666666">
v:src=3D"cid:image001.jpg@01CA60B3.3F974090" v:shapes=3D"_x0000_Mail" =
width=3D0
height=3D0 class=3Dshape style=3D'display:none;width:0;height:0'>



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Need some help here with checkboxes in an html =
form.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>My issue is I have a form that needs to be viewed with
checkboxes filled in depending on the values in the =
table.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>I tried:



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'><INPUT class=3Dtext id=3D"myCheck1" =
type=3Dcheckbox
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:red'>&=
lt;?php
if ( $row[33] =3D 'no') { echo "checked=3Dyes";  } else { =
echo '';  }
?> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> value=3D"PFDs"
name=3Df_sequipment1></b><font =
size=3D"2">PFDs<b>



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>but the checkbox field is always =
checked.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>I thought of JavaScript also but it would have to be a =
“if
$row[33] then run a JavaScript function” .  This is not =
working for
me neither.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Sorry if this seems trivial but I need your =
help.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Thanks in advance.....



style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'> 



style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'> 



 









------=_NextPart_001_000B_01CA60B3.9972F1E0--

------=_NextPart_000_000A_01CA60B3.9972CAD0--

Re: Checkbox in PHP form

am 09.11.2009 02:45:00 von Manuel Lemos

Hello,

on 11/08/2009 11:39 PM Ernie Kemp said the following:
> Need some help here with checkboxes in an html form.
>
>
>
> My issue is I have a form that needs to be viewed with checkboxes filled
> in depending on the values in the table.
>
>
>
> I tried:
>
> > 'no') { echo "checked=yes"; } else { echo ''; } ?> value="PFDs"
> name=f_sequipment1>
PFDs
>
> but the checkbox field is always checked.

It should be $row[33] == 'no'

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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

Re: Re: Checkbox in PHP form

am 09.11.2009 06:52:08 von Brian Hazelton

'no') { echo "checked="checked"; } ?> value="PFDs"
name=f_sequipment1>
PFDs


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

Re: Checkbox in PHP form

am 10.11.2009 20:50:39 von Adam Randall

--001485ec0fece61eed0478099f48
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

==
'no' ? ' checked=3D"checked"' : '' ); ?> value=3D"PFDs"
name=3D"f_sequipment1">
PFDs
Or with short tags:

=3D 'no' ? '
checked=3D"checked"' : '' ?> value=3D"PFDs" name=3D"f_sequipment1">
t
size=3D"2">PFDs
Adam.

On Sun, Nov 8, 2009 at 5:39 PM, Ernie Kemp wrote:

> Need some help here with checkboxes in an html form.
>
>
>
> My issue is I have a form that needs to be viewed with checkboxes filled =
in
> depending on the values in the table.
>
>
>
> I tried:
>
> =3D 'no')
> { echo "checked=3Dyes"; } else { echo ''; } ?> value=3D"PFDs"
> name=3Df_sequipment1>
PFDs
>
> but the checkbox field is always checked.
>
>
>
> I thought of JavaScript also but it would have to be a â€=9Cif $row[3=
3] then
> run a JavaScript functionâ€=9D . This is not working for me neither.
>
>
>
> Sorry if this seems trivial but I need your help.
>
>
>
> Thanks in advance.....
>
>
>
>
>
>
>
>
>



--=20
Adam Randall
http://www.xaren.net
AIM: blitz574

--001485ec0fece61eed0478099f48--

Re: Re: Checkbox in PHP form

am 10.11.2009 20:51:08 von Adam Randall

On Sun, Nov 8, 2009 at 9:52 PM, Brian Hazelton wrote=
:
> ==
> 'no') { echo "checked=3D"checked";  } ?> value=3D"PFDs"
> name=3Df_sequipment1>
PFDs
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--=20
Adam Randall
http://www.xaren.net
AIM: blitz574

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