Ver Mensaje Individual
  #5 (permalink)  
Antiguo 11/06/2007, 15:36
Avatar de franklin85
franklin85
 
Fecha de Ingreso: octubre-2006
Mensajes: 103
Antigüedad: 18 años, 4 meses
Puntos: 0
Re: select asociados

haber si te entiendo: seria algo así:
Código PHP:
//Creamos los SELECTS
var selPais=document.createElement("SELECT");
var 
selProv=document.createElement("SELECT");
var 
selCiud=document.createElement("SELECT"); 
elimino esta parte del codigo y en ves de esa coloco el html con id, algo asi o me equivoco(disculpa pero no entiendo el lenguaje javascripts)
Código HTML:
<table width="409" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="189"><font class="registro">Departamento</font></td>
<td width="220">
<select name="departamento" id="depa">
</select>
</td>
</tr>
<tr><td height="5"></td></tr>
<tr>
<td width="189"><font class="registro">Provincia</font></td>
<td width="220">
<select name="provincia" id="provi">
</select>
</td>
</tr>
<tr><td height="5"></td></tr>
<tr>
<td width="189"><font class="registro">Distrito</font></td>
<td width="220">
<select name="distrito" id="ciud">
</select>
</td>
</tr>
</table> 
y con en vez de esto lo referenciamos
Código PHP:
//adjuntamos al documento
document.body.getElementsById(depa);
document.body.getElementsById(provi);
document.body.getElementsById(ciud); 
Por favor te agradesco mucho tu ayuda.