hi guys, i trying to create a 2 level listboxes where the contents of the 2nd listboxes depends on the value of the 1st listbox.i was trying to tweak around with the javascript, getting it to submit so that i can retrieve.but the data doesn't seen to be submittingPHP Code:<select name="cat_listbox" onchange= "javascript:Document.submit()">;
<?php
$sql = "SELECT distinct Category_Name from Category ORDER BY Category_Name asc";
$result = mysql_query($sql);
while($menu = mysql_fetch_array($result))
{
$menu1= $menu['Category_Name'];
echo '<option value="'.$menu1.'">'.$menu1.'</option>';
}
?>
</select>
<select name="subcat_listbox" onchange= "javascript:new()">;
<?php
//$catID = $_POST("cat_listbox.value");
$sql = "SELECT distinct Sub_Category_Name from Sub_Category ORDER BY Sub_Category_Name asc
WHERE Sub_Category_ID = '".$catID."'";
$result = mysql_query($sql);
while($menu = mysql_fetch_array($result))
{
$menu1= $menu['Sub_Category_Name'];
echo '<option value="'.$menu1.'">'.$menu1.'</option>';
}
?>
</select>
I been up all nite trying to figure it out
many thanks for your advises !!![]()





Bookmarks