Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/06/2008, 21:13
Avatar de Highlander
Highlander
 
Fecha de Ingreso: junio-2006
Ubicación: Concepción, Chile
Mensajes: 475
Antigüedad: 17 años, 10 meses
Puntos: 4
Sugerencias sobre listado desplegable y modificación

Hola tengo el siguiente codigo pero me gustaria hacer que la lista desplegable de CURSO cambiara automaticamente segun el ESTABLECIMIENTO seleccionado, la verdad he buscado y encontrado varias alternativas pero no me decido por ninguna, cual seria la mas recomendable y rapida de implementar? acepto sugerencias.

Código:
<form name='busca' form action="agregacar.php" method="post">
<table width="34%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" colspan="2" bgcolor="#AEB8DD"><div align="center">Lista Escolar </div></td>
    </tr>
  <tr>
    <td width="30%" bgcolor="#CFD0FC"><div align="right">Establecimiento&nbsp;</div></td>
    <td width="70%" height="28" bgcolor="#CFD0FC">
				   <?php 
				   include("conexion.php");
				   $link=conectar();
			   	   $consulta = "SELECT * FROM establecimiento ORDER BY NOM_ESTA"; 
			       $resultado = mysql_query($consulta,$link);
				    ?>
			       <select name="id_esta"  id="id_esta">
			        <option value="" selected="selected">Seleccionar</option>
			        <?php
					while($datos = mysql_fetch_array($resultado)){
					?>
					<option value="<?php echo $datos["ID_ESTA"] ?>"><?php echo $datos["NOM_ESTA"] ?>
					<?php $id_ciudad=$datos["ID_CIUDAD"];
						  $consulta1 = "SELECT * FROM ciudad where id_ciudad = '$id_ciudad'"; 
			      		  $resultado1 = mysql_query($consulta1,$link);
						  $datos1 = mysql_fetch_array($resultado1); 
						  $nom_ciudad=$datos1["NOM_CIUDAD"]?>
					 (<?php echo $nom_ciudad ?>)</option>
					<?php
					}
					mysql_close($link);
			 		?>
      </select>
			       <label></label>
      <label></label></td>
  </tr>
  <tr>
    <td width="30%" bgcolor="#CFD0FC"><div align="right">Curso&nbsp;</div></td>
    <td width="70%" height="28" bgcolor="#CFD0FC">
				   <?php 
				   $link=conectar();
			   	   $consulta = "SELECT * FROM curso ORDER BY ID_CURSO"; 
			       $resultado = mysql_query($consulta,$link); ?>
			       <select name="id_curso"  id="id_curso">
			        <option value="" selected="selected">Seleccionar</option>
			        <?php
					while($datos = mysql_fetch_array($resultado)){
					?>
					<option value="<?php echo $datos["ID_CURSO"] ?>"><?php echo $datos["NOM_CURSO"] ?></option>
					<?php
					}
					mysql_close($link);
			 		?>
      </select>
			       <label></label>
      <label></label></td>
  </tr>
  <tr>
    <td height="30" colspan="2" bgcolor="#bac2dd"><div align="center">
      <label>
      <input type="reset" name="Reset" value="Limpiar" />
      </label>
      <input name="boton01" type="submit" id="boton01"  value="Buscar" />
	  
      <label>
      <input name="boton03" type='button' onClick="location='busqueda.php'" value='Salir'/>
      </label>
    </div></td>
    </tr>
</table>
</form>