This select menu is contained within a function called 'ShowCart' which shows the items in a users shopping cart. Anyway, I'm trying to embed the code for the 'select' menu and not having any luck.
Here is what I have thus far in my HTML code - I'd like to embed this in the PHP function 'ShowCart' so that I can have the 'select' menu appear:
Code: Select all
<td width="15%" height="25"><select name="<?php echo $rowї"piecenum"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($rowї"qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>
</td>Code: Select all
<?php
//Show quantity of this item in a text input widget. The user can alter the quantity and update it
echo "\n<tr>";
echo "\n\t<td>" .
"<select name=",$row["piecenum"]," onChange=UpdateQty(this)>";
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($row["qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
"</select></td>";
?>Can anyone help me so that I can get this working? It seems to debug fine, but the right result isn't appearing.
Thanks!