Desde un pulldown necesito jalar la informacion de una base de datos, pero al momento de seleccionar debe de llamar otro pulldown pero este tambien debe de llamar los datos de la base de datos !!!!
El ejemplo es el siguiente el primer pulldown
<script type="text/javascript">
function VisualizarTorre(Cual){
document.getElementById('Select_Baja California').style.display=(Cual=='Baja California')?'':'none';
document.getElementById('Select_Baja California').disabled=(Cual=='Baja California')?false:true;
document.getElementById('Select_Central').style.di splay=(Cual=='Central')?'':'none';
document.getElementById('Select_Central').disabled =(Cual=='Central')?false:true;
document.getElementById('Select_Noroeste').style.d isplay=(Cual=='Noroeste')?'':'none';
document.getElementById('Select_Noroeste').disable d=(Cual=='Noroeste')?false:true;
}
</script>
<select onchange="VisualizarTorre(this.value);">
<?php
if ($region == 0)
{
echo("<option value=\"0\" selected> [Seleccione una región] </option>");
}
$query = "SELECT Id, Nombre FROM unidad
ORDER BY Id";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_object($result))
{
echo("<OPTION VALUE=\"" . $row->unidad . "\" ");
if ($unidad == $row->unidad) echo(" selected");
echo(">" . $row->Nombre . "</option>");
}
mysql_free_result($result);
echo("</select> </td>");
?>
segundo pulldown
</div></td>
<td width="12%"><div align="center">Unidad</div></td>
<td width="44%"><div align="center"> <script type="text/javascript">
function VisualizarTorre(Cual){
document.getElementById('Select_Baja California').style.display=(Cual=='Baja California')?'':'none';
document.getElementById('Select_Baja California').disabled=(Cual=='Baja California')?false:true;
document.getElementById('Select_Central').style.di splay=(Cual=='Central')?'':'none';
document.getElementById('Select_Central').disabled =(Cual=='Central')?false:true;
document.getElementById('Select_Noroeste').style.d isplay=(Cual=='Noroeste')?'':'none';
document.getElementById('Select_Noroeste').disable d=(Cual=='Noroeste')?false:true;
}
</script>
<select onchange="VisualizarTorre(this.value);">
<?php
if ($region == 0)
{
echo("<option value=\"0\" selected> [Seleccione una región] </option>");
}
$query = "SELECT Id, Nombre FROM unidad
ORDER BY Id";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_object($result))
{
echo("<OPTION VALUE=\"" . $row->unidad . "\" ");
if ($unidad == $row->unidad) echo(" selected");
echo(">" . $row->Nombre . "</option>");
}
mysql_free_result($result);
echo("</select> </td>");
?>
Bueno el error es que no aparece el segundo pulldown no se en que este fallando mi escript o que este haciendo mal !!!!
alguien que me pueda ayudar !!!!
