0

I'm trying to create a drop down menu that dynamically updates a table. The drop down list shows the items in the category table, but they are not clickable--they can't be selected. What am I doing incorrectly?

    $sql = "SELECT pd_id, c.cat_id, cat_name, pd_name, pd_thumbnail
        FROM tbl_product p, tbl_category c
        WHERE p.cat_id = c.cat_id $sql2
        ORDER BY pd_name";
$result     = dbQuery(getPagingQuery($sql, $rowsPerPage));
$pagingLink = getPagingLink($sql, $rowsPerPage, $queryString);

$categoryList = buildCategoryOptions($catId);

?> 
<p>&nbsp;</p>
<form action="processProduct.php?action=addProduct" method="post"  name="frmListProduct" id="frmListProduct">
 <table width="100%" border="0" cellspacing="0" cellpadding="2" class="text">
  <tr>
   <td align="right">View products in : 
    <select name="cboCategory" class="box" id="cboCategory" onChange="viewProduct();">
     <option selected>All Category</option>
    <?php echo $categoryList; ?>
   </select>
 </td>
 </tr>
</table>
4

1 回答 1

0

foreach ( $query->result_array () as $val ) {

`$cat=$val['categoryid'];`

echo "<OPTION value=\"$cat\">$cat</OPTION>"; }

尝试在 php 中构建,如上所示。

于 2012-12-11T08:49:34.273 回答