Re: problem with dynamic populating checkbox
- From: Dennis de Wit <newsgroups@xxxxxxxxxxxxxxx>
- Date: Tue, 29 Aug 2006 10:53:39 +0200
calmsqurill@xxxxxxxxx wrote:
HI,
First of all im vry new to PHP, i like to retrieve a value from DB,
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????
Can anyone help, plzzzzzzz!!!
[cut]
Hi
Check the output of your code. As you can see it places if($event_publish==1){'CHECKED';}?> straight into your code. This is because it is misplaced.
Solution:
Stop your string after 'publish'. Then start a new line with the if statement, remove the ?>, and start a new string again:
<td class='navText'
align='center' class=$c><input type='checkbox'
name='publish' ";
if($event_publish==1){'CHECKED';}
echo "</td>... etc.
Besides, CHECKED should be checked="checked" to comply with new xhtml rules (Safari on Mac relies on this :-s)
Dennis
.
- References:
- problem with dynamic populating checkbox
- From: calmsqurill
- problem with dynamic populating checkbox
- Prev by Date: Re: why does this not work?
- Next by Date: Re: php under firefox
- Previous by thread: problem with dynamic populating checkbox
- Next by thread: php under firefox
- Index(es):
Relevant Pages
|