Re: Reg. Dynamically populate a checkbox
- From: "Mumia W." <mumia.w.18.spam+nospam.usenet@xxxxxxxxxxxxx>
- Date: Tue, 29 Aug 2006 10:59:22 GMT
On 08/29/2006 03:01 AM, calms wrote:
Mumia W. wrote:On 08/29/2006 02:04 AM, calms wrote:HI,Hi
First of all im vry new to PHP, i like to retrieve a value from DB,It's a good idea to learn HTML before learning PHP. HTML is a
accordingly i like to display the checkbox, either checked or not.
Now im able to retrieve the value from DB, i can show even show the
checkbox, but i cant make it checked????
[...]
complicated language with one purpose, and PHP is another
complicated language with a slightly different purpose.
Learning both at the same time can be overwhelming.
The "checked" attribute, in HTML, is used to make a checkbox
checked.
http://www.w3.org/TR/html4/interact/forms.html#checkbox
thks for your reply,
but as you can see i used the 'checked' attribute, still i cant make it. I knw tht i have done some mistake in the echo statement. as follows,
It's difficult to understand what you write. Please spell words completely if you can.
echo "<tr>
<td Class='navText' align='center' class=$c>$event_id</td>
<td class='navText' class=$c>$event_name</td>
<td class='navText' align='center' class=$c><INPUT TYPE=CHECKBOX
NAME='publish' VALUE=1 <?php echo ($event_publish == 1 ? 'CHECKED':
''); ?></td>
<td class='navText' align='center' class=$c><a
href='delete_event.php?event_id=$event_id'>$take_action</a></td></tr>";
kindly correct me...
thks
Within an echo statement, <? php-code ?> does not work. Just output a variable's value:
$event_publish_checked = ($event_publish == 1 ? 'CHECKED' : '');
echo "<tr>
<td Class='navText' align='center' class=$c>$event_id</td>
<td class='navText' class=$c>$event_name</td>
<td class='navText' align='center' class=$c><INPUT TYPE=CHECKBOX
NAME='publish' VALUE=1 $event_publish_checked </td>
<td class='navText' align='center' class=$c><a
href='delete_event.php?event_id=$event_id'>$take_action</a></td></tr>";
.
- Follow-Ups:
- Re: Reg. Dynamically populate a checkbox
- From: mootmail-googlegroups
- Re: Reg. Dynamically populate a checkbox
- References:
- Reg. Dynamically populate a checkbox
- From: calms
- Re: Reg. Dynamically populate a checkbox
- From: Mumia W.
- Re: Reg. Dynamically populate a checkbox
- From: calms
- Reg. Dynamically populate a checkbox
- Prev by Date: Re: Reg. Dynamically populate a checkbox
- Next by Date: Re: Reg. Dynamically populate a checkbox
- Previous by thread: Re: Reg. Dynamically populate a checkbox
- Next by thread: Re: Reg. Dynamically populate a checkbox
- Index(es):
Relevant Pages
|