Hi all,
I am creating an cms/admin where I want a drop down consists of list of product and an another drop down consists of list of sub products. On selection a product ,the corresponding lists of sub product will be generated in sub product drop down. using javascript I did
if(empty($_POST["productid"]))
{
$product_id=!empty($_REQUEST['pid']);
echo $product_id;
}
else
{
$product_id=$_POST['productid'];
/*THIS PART IS NOT WORKING */
}
<SCRIPT LANGUAGE="javascript">
function update_post()
{
document.frm.submit();
}
</SCRIPT>
<select id="productid" name="productid" onChange="update_post();">
<?php
$sql_all ="select * from product";
$qry_selectall=mysql_query($sql_all);
while($res_selectall=mysql_fetch_array($qry_selectall))
{
$content_all=$res_selectall['id'];
$code = $res_selectall['page_title'];
?>
<option id="prodid" value="<?php echo $content_all;?>" <?php if($content_all==$page_id) echo 'selected' ?> ><?php echo $code;?></option>
<?php
}
?>
</select>
where the else part is not working. If any one can post a full code for two drop down using php ,html and javascript.......