how do i this? i have no idea....i need to incorporate it on an html form
pleas help?
i will get the data from this line(php) and must be able to select one from the dropdown and get the id/name from the one selected
$supplier_names = LpmAdnetworkPeer::getByName($catcher_id);
thank you
how do i create a dropdown menu?
Moderator: General Moderators
Re: how do i create a dropdown menu?
sorted...
Code: Select all
<td width='100px'>Suppliers
<select>
<?php
$catcher_id = $service->getCatcherId();
$supplier_names = LpmAdnetworkPeer::getByName($catcher_id);
foreach($supplier_names as $row)
{
?>
<option><?php echo $row->getName();?></option>
<?php
}
?>
</select>
</td>
Last edited by Benjamin on Fri Jan 07, 2011 2:09 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
Reason: Added [syntax=php] tags.
Re: how do i create a dropdown menu?
only question now is how do i het the id of the one selected from the list please???
Re: how do i create a dropdown menu?
Give your <select> a "name" attribute (<select name = "suppliers">), and each <option> a "value" attribute (<option value = "12">). Then when the form is submitted, $_POST['suppliers'] will equal 12 (or whatever option is selected when the form is submitted).
Do a google search for HTML select box & you should get some pages giving your more details on how they work.
Do a google search for HTML select box & you should get some pages giving your more details on how they work.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: how do i create a dropdown menu?
thanks very much got it 