Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to fill listbox from table 1

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I am trying to fill a listbox from a query. It works in a dropdown combo, but I want a listbox showing around 20 records, having a verticle scrollbar. I have searched all over but keep finding dropdown boxes. The bit of code for the listbox is. Thanks

echo '<Select Barcode="Barcode">';
while($nt=mysql_fetch_array($result)) { // Array or records stored in nt




echo '<option value="'.$nt[Barcode].'">' .$nt['Barcode'].'</option>';
}
echo '</select>'; // closing list
 
set the name attribute so that it is usable in php. and then set the size attribute to turn it into list box. size="20" should do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top