Esto fue lo que me pediste por privado.........
combo anidado sin bd.php
Código PHP:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(window).load(function(){
$(".subca, .marca").hide();
$("#categoria").change(function(){
$(".subca, .marca").hide();
$(".subca_" + $(this).val()).show();
});
$("#subcategoria").change(function(){
$(".marca").hide();
$(".marca_" + $(this).val()).show();
});
});
</script>
</head>
<body>
<table>
<tr>
<td>
<select id="categoria" name="categoria">
<option value=''>Seleecione</option>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>
</td>
<td>
<select id="subcategoria" name="subcategoria">
<option value=''>Seleecione</option>
<option class='subca subca_1' value='11'>11</option>
<option class='subca subca_1' value='12'>12</option>
<option class='subca subca_2' value='21'>21</option>
<option class='subca subca_2' value='22'>22</option>
<option class='subca subca_3' value='31'>31</option>
<option class='subca subca_3' value='32'>32</option>
</select>
</td>
<td>
<select id="marca" name="marca">
<option value=''>Seleecione</option>
<option class='marca marca_11' value='111'>111</option>
<option class='marca marca_11' value='112'>112</option>
<option class='marca marca_12' value='121'>121</option>
<option class='marca marca_12' value='122'>122</option>
<option class='marca marca_21' value='211'>211</option>
<option class='marca marca_21' value='212'>212</option>
<option class='marca marca_22' value='221'>221</option>
<option class='marca marca_22' value='222'>222</option>
<option class='marca marca_31' value='311'>311</option>
<option class='marca marca_31' value='312'>312</option>
<option class='marca marca_32' value='321'>321</option>
<option class='marca marca_32' value='322'>322</option>
</select>
</td>
</tr>
</table>
</body>
</html>
y combo anidado con bd.php
Código PHP:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(window).load(function(){
$(".subca, .marca").hide();
$("#categoria").change(function(){
$(".subca, .marca").hide();
$(".subca_" + $(this).val()).show();
});
$("#subcategoria").change(function(){
$(".marca").hide();
$(".marca_" + $(this).val()).show();
});
});
</script>
</head>
<body>
<?php include_once("conex.php"); ?>
<table>
<tr>
<td>
<select id="categoria" name="categoria">
<option value=''>Seleecione</option>
<?php
$result = mysql_query("select cat_ID, catCategoria from categories", $db_link); while($row = mysql_fetch_array($result)) print("<option value='$row[0]'>$row[1]</option>"); ?>
</select>
</td>
<td>
<select id="subcategoria" name="subcategoria">
<option value=''>Seleecione</option>
<?php
$result = mysql_query("select id_cat, id_subc, nom_subc from sub_categories", $db_link); while($row = mysql_fetch_array($result)) print("<option class='subca subca_$row[0]' value='$row[1]'>$row[2]</option>"); ?>
</select>
</td>
<td>
<select id="marca" name="marca">
<option value=''>Seleecione</option>
<?php
$result = mysql_query("select id_subc, id_marca, nom_marca from marca", $db_link); while($row = mysql_fetch_array($result)) print("<option class='marca marca_$row[0]' value='$row[1]'>$row[2]</option>"); ?>
</select>
</td>
</tr>
</table>
</body>
</html>
Suerte y gracias por el karma