Stupid checkbox question
Posted: Fri Apr 06, 2007 9:36 pm
feyd | Please use
This pulls the options from the database, GREAT.
Now I can not for the life of me figure out how to get the checkbox "checked" from the value in the database? does the if statement above not cover that for the professionOne boxes?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
another checkbox question for the experts...
i have the following code:Code: Select all
<?php
while($row = mysql_fetch_array($resultAllProfessionsOne))
{
echo "<input type=\"checkbox\" name=\"" . $row['ProfessionName'] . "\" value=\"" . $row['ProfessionID'] . "\">";
if ($row['ProfessionID'] == $ProfessionOne) { echo "Checked"; }
echo $row['ProfessionName'];
echo "<br />";
} ?></td>
<td>
<?php
while($row = mysql_fetch_array($resultAllProfessionsTwo))
{
echo "<input type=\"checkbox\" name=\"" . $row['ProfessionName'] . "\" value=\"" . $row['ProfessionID'] . "\">";
echo $row['ProfessionName'];
echo "<br />";
} ?>Now I can not for the life of me figure out how to get the checkbox "checked" from the value in the database? does the if statement above not cover that for the professionOne boxes?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]