You are here: Re: How do you do selected in a multi-value list box in a form? « PHP Programming Language « IT news, forums, messages
Re: How do you do selected in a multi-value list box in a form?

Posted by rich on 10/25/61 11:48

Here is part of the code with explaination

This is the cell in a table that is part of a form.

<td>
<select name="stages[]" multiple="multiple">
<?php
$allstages = allstages();
while ($allstagerows=pg_fetch_array($allstages)) {
$eachstage= $allstagerows["stageid"];
while($drcatrow = pg_fetch_array($dresscat)){
if ($drcatrow["stageid"] == $eachstage){ ?>
<option value=<?php echo $eachstage;?> selected="selected"><?php
echo $allstagerows["stage"]?></option>
<?php }else{ ?>
<option value=<?php echo $eachstage;?>><?php echo
$allstagerows["stage"]?></option>
<?php }
}
}
?>
</select>
</td>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация