i have the following code:
<td width='100px'>Suppliers
<select name="supplier">
<?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>
then on the same form i have a submit button that takes me to the next form..the problem now is how can i access the ID of the item seleted in the dropdown on the NEXT form please?
i can get the name from the list by $_POST['supplier'] on the next form
thanks
how to get id from selected item in dropdown list?
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: how to get id from selected item in dropdown list?
Make an input type hidden like this:
<input type="hidden" name="id" value="<?php echo $catcher_id; ?>" ?>
and get it on the other form like this:
$id = $_POST['id'];
<input type="hidden" name="id" value="<?php echo $catcher_id; ?>" ?>
and get it on the other form like this:
$id = $_POST['id'];