Código HTML:
[PHP]<form id="formulario" name="formulario" method="post" action="guardar_articulo.php" enctype="multipart/form-data"> <input id="accion" name="accion" value="alta" type="hidden"> <table class="fuente7" width="98%" cellspacing=0 cellpadding=3 border=0> <?php $query_familias="SELECT * FROM familias WHERE borrado=0 ORDER BY nombre ASC"; $res_familias=mysql_query($query_familias); $contador=0; ?> <tr> <td width="5%">FAMILIA</td> <td><select id="cboFamilias" name="AcboFamilias" class="comboGrande" onChange="document.getElementById('AcbosubFamilias ').style.display='inline';"> <option value="0">Seleccione un Tipo</option> <?php while ($contador < mysql_num_rows($res_familias)) { ?> <option value="<?php echo mysql_result($res_familias,$contador,"codfamilia") ?>"><?php echo mysql_result($res_familias,$contador,"nombre")?></option> <? $contador++; } ?> </select> <img src="../img/botonnuevafamilia.jpg" width="100" height="20" align="absmiddle" border="1" onClick="nueva_familia()"onMouseOver="style.cursor =cursor"> <img src="../img/botonaceptar.jpg" width="73" height="20" align="absmiddle" border="1" onclick="document.location.reload();" onMouseOver="style.cursor=cursor"> </td> </tr> <?php $query_subfamilias="select * from articulos,familias where articulos.codfamilia=familias.codfamilia order by articulos.descripcion ASC"; $res_subfamilias=mysql_query($query_subfamilias); $contador=0; ?> <tr> <td width="5%">SUBFAMILIA</td> <td><select id="cbosubFamilias" name="AcbosubFamilias" class="comboGrande"> <option value="0">Seleccione un Tipo</option> <?php while ($contador < mysql_num_rows($res_subfamilias)) { ?> <option value="1<?php echo mysql_result($res_subfamilias,$contador,"codfamili a")?>"><?php echo mysql_result($res_subfamilias,$contador,"descripci on")?></option> <? $contador++; } ?> </select> </td>[/PHP]