Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/06/2011, 06:59
Gabriel_Bazeth
 
Fecha de Ingreso: junio-2011
Ubicación: Medellin-Antioquia-Colombia
Mensajes: 13
Antigüedad: 12 años, 10 meses
Puntos: 1
Respuesta: problema con bucle for

Gracias por el dato Danielfuzz, aqui esta mi html:

Código HTML:
Ver original
  1. <form name="listas" method="post" action="">
  2.         <table id="tabla" border="3px">
  3.             <tr>
  4.                 <td><strong>Elija una subregion</strong>
  5.                     <select name="subregion" onchange="def_subr()">
  6.                             <option value="0">Seleccione...</option>
  7.                         <%
  8.                            //organizamos la consulta
  9.                            String[][] subregiones;
  10.                            //la ejecutamos
  11.                            guardar bd=new guardar();
  12.                            subregiones=bd.Consultar_modificado("SELECT subregion.idSubregion, subregion.nombre  FROM subregion", 2);
  13.  
  14.                            //relleno la lista
  15.                            for(int i=0; i < subregiones.length;i++){
  16.                              
  17.                        %>
  18.                             <option value="<%=subregiones[i][0]%>"><%=subregiones[i][1]%></option>
  19.                         <%
  20.                                }
  21.                          
  22.                        %>
  23.                     </select>
  24.                 </td>
  25.             </tr>
  26.             <tr>
  27.                 <td>
  28.                     <strong>Elija una region</strong>
  29.                     <select name="region">
  30.                         <option value="seleccione">Seleccione...</option>
  31.                     </select>
  32.                 </td>
  33.             </tr>
  34.         </table>
  35.                 </form>

el select de nombre subregion es el select del cual depende el select region, el select region es el que intento limpiar cuando en el select subregion se elige el index 0.