Foros del Web » Programando para Internet » Javascript »

3 listas dependientes

Estas en el tema de 3 listas dependientes en el foro de Javascript en Foros del Web. Bueno necesito algo así: <a href='ir.asp?http://www.aspfacil.com/codigo/abrir.asp?id=7' target='_blank'>http://www.aspfacil.com/codigo/abrir.asp...</a> Pero con 3 listas que dependan la 3ª de la 2ª y la 2ª de la 1ª. Ojala ...
  #1 (permalink)  
Antiguo 24/04/2002, 00:13
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 4 meses
Puntos: 1
3 listas dependientes

Bueno necesito algo así:

<a href='ir.asp?http://www.aspfacil.com/codigo/abrir.asp?id=7' target='_blank'>http://www.aspfacil.com/codigo/abrir.asp...</a>

Pero con 3 listas que dependan la 3ª de la 2ª y la 2ª de la 1ª.

Ojala alguien me pueda echar una mano.

Saludos


<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #2 (permalink)  
Antiguo 24/04/2002, 04:55
jgg
 
Fecha de Ingreso: agosto-2001
Mensajes: 56
Antigüedad: 22 años, 8 meses
Puntos: 0
Re: 3 listas dependientes

Hola,
en este enlace tienes un tutorial y el código
para la &quot;triple lista&quot;.
<a href='ir.asp?http://www.aspfree.com/authors/salimn/optionex.asp' target='_blank'>http://www.aspfree.com/authors/salimn/op...</a>

Un saludo!!

[email protected]
  #3 (permalink)  
Antiguo 24/04/2002, 10:27
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 4 meses
Puntos: 1
Re: 3 listas dependientes

Excelente !!!!!!!!!!

Muchisisismas gracias!!!!!! :)

Saludos

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #4 (permalink)  
Antiguo 19/08/2003, 09:07
 
Fecha de Ingreso: abril-2003
Ubicación: Villahermosa, Mexico
Mensajes: 16
Antigüedad: 21 años
Puntos: 0
No funciona la liga

Hola... intente accesar a la liga... del ejemplo.. de las listas dependientes.. y me marca error.. en la liga.. no se si no funcione.. la liga.. o este fuera de servicio..

gracias
  #5 (permalink)  
Antiguo 23/10/2003, 16:24
Avatar de domi  
Fecha de Ingreso: septiembre-2003
Ubicación: Bogotá D.C
Mensajes: 61
Antigüedad: 20 años, 7 meses
Puntos: 0
AL PARECER LA PAGINA A LA QUE HACE REFERENCIA JGG HA SIDO QUITADA...ALGUNO SABE DONDE ENCUENTRO ALGO ASI?
__________________
¡Que Tengas Suertecita!
  #6 (permalink)  
Antiguo 24/10/2003, 09:02
Avatar de RucarMaN  
Fecha de Ingreso: julio-2003
Ubicación: Caripito Edo Monagas
Mensajes: 169
Antigüedad: 20 años, 9 meses
Puntos: 1
Información Listas desplegables dependientes

<html>
<head>
<title>Listas desplegables dependientes</title>

</head>

<BODY style="font-family: Verdana">
<p align="center"><b>Listas desplegables dependientes 5</b></p>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[3] = "Camión";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Tren";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Coche";
arrItemsGrp1[5] = 1;

arrItems1[6] = "Barco";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Submarino";
arrItemsGrp1[7] = 2;

arrItems1[0] = "Aviones";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Ultraligero";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Ala delta";
arrItemsGrp1[2] = 3;

var arrItems2 = new Array();
var arrItemsGrp2 = new Array();

arrItems2[21] = "747";
arrItemsGrp2[21] = 0
arrItems2[22] = "Cessna";
arrItemsGrp2[22] = 0

arrItems2[31] = "Kolb Flyer";
arrItemsGrp2[31] = 1
arrItems2[34] = "Kitfox";
arrItemsGrp2[34] = 1

arrItems2[35] = "Schwietzer Glider";
arrItemsGrp2[35] = 2

arrItems2[99] = "Chevy Malibu";
arrItemsGrp2[99] = 5
arrItems2[100] = "Lincoln LS";
arrItemsGrp2[100] = 5
arrItems2[57] = "BMW Z3";
arrItemsGrp2[57] = 5

arrItems2[101] = "F-150";
arrItemsGrp2[101] = 3
arrItems2[102] = "Tahoe";
arrItemsGrp2[102] = 3

arrItems2[103] = "Tren de carga";
arrItemsGrp2[103] = 4
arrItems2[104] = "Tren de pasajeros";
arrItemsGrp2[104] = 4

arrItems2[105] = "Contenedor de aceite";
arrItemsGrp2[105] = 6
arrItems2[106] = "Barco de pesca";
arrItemsGrp2[106] = 6

arrItems2[200] = "Los Angelas Class";
arrItemsGrp2[200] = 7
arrItems2[201] = "Kilo Class";
arrItemsGrp2[201] = 7
arrItems2[203] = "Seawolf Class";
arrItemsGrp2[203] = 7

function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[Selecciona]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>

</HEAD>



<BODY style="font-family: Verdana">

<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[Selecciona]</option>
<option value=1>Tierra</option>
<option value=2>Mar</option>
<option value=3>Aire</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">
</SELECT>
<SELECT id=thirdChoice name=thirdChoice>
</SELECT>
</TD>
</TR>
</TABLE>
</form>
__________________
Con la ayuda de todos seremos mejores...

http://www.pemoweb.com
  #7 (permalink)  
Antiguo 04/05/2004, 07:45
 
Fecha de Ingreso: mayo-2004
Ubicación: Santa Cruz
Mensajes: 1
Antigüedad: 19 años, 11 meses
Puntos: 0
Re: Re: 3 listas dependientes

Disculpa ,e stuve leyendo q solucionaste el problema de las 3 listas dèpendientes, no me podrias pasar el ejemplo por favor!!!

Cita:
Mensaje Original por urjose
Excelente !!!!!!!!!!

Muchisisismas gracias!!!!!! :)

Saludos

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #8 (permalink)  
Antiguo 29/11/2005, 10:51
 
Fecha de Ingreso: noviembre-2005
Mensajes: 3
Antigüedad: 18 años, 5 meses
Puntos: 0
3 litas dependientes

ok ya tengo un ejemplo de 3 listas dependientes con acces ahora quiero que al seleccionar la ultima me muestre el contenido de las 3 selecciones osea
si le doy a la primer ejemplo marca que me cambia a la base de datos que seleccione en ese select cuando seleccione auto se seleccione la tabla y el modelo que lo busque en la table y me despliege todo lo que encuentre
  #9 (permalink)  
Antiguo 23/03/2009, 00:45
 
Fecha de Ingreso: marzo-2009
Mensajes: 9
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: Listas desplegables dependientes

Cita:
Iniciado por RucarMaN Ver Mensaje
<html>
<head>
<title>Listas desplegables dependientes</title>

</head>

<BODY style="font-family: Verdana">
<p align="center"><b>Listas desplegables dependientes 5</b></p>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[3] = "Camión";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Tren";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Coche";
arrItemsGrp1[5] = 1;

arrItems1[6] = "Barco";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Submarino";
arrItemsGrp1[7] = 2;

arrItems1[0] = "Aviones";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Ultraligero";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Ala delta";
arrItemsGrp1[2] = 3;

var arrItems2 = new Array();
var arrItemsGrp2 = new Array();

arrItems2[21] = "747";
arrItemsGrp2[21] = 0
arrItems2[22] = "Cessna";
arrItemsGrp2[22] = 0

arrItems2[31] = "Kolb Flyer";
arrItemsGrp2[31] = 1
arrItems2[34] = "Kitfox";
arrItemsGrp2[34] = 1

arrItems2[35] = "Schwietzer Glider";
arrItemsGrp2[35] = 2

arrItems2[99] = "Chevy Malibu";
arrItemsGrp2[99] = 5
arrItems2[100] = "Lincoln LS";
arrItemsGrp2[100] = 5
arrItems2[57] = "BMW Z3";
arrItemsGrp2[57] = 5

arrItems2[101] = "F-150";
arrItemsGrp2[101] = 3
arrItems2[102] = "Tahoe";
arrItemsGrp2[102] = 3

arrItems2[103] = "Tren de carga";
arrItemsGrp2[103] = 4
arrItems2[104] = "Tren de pasajeros";
arrItemsGrp2[104] = 4

arrItems2[105] = "Contenedor de aceite";
arrItemsGrp2[105] = 6
arrItems2[106] = "Barco de pesca";
arrItemsGrp2[106] = 6

arrItems2[200] = "Los Angelas Class";
arrItemsGrp2[200] = 7
arrItems2[201] = "Kilo Class";
arrItemsGrp2[201] = 7
arrItems2[203] = "Seawolf Class";
arrItemsGrp2[203] = 7

function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[Selecciona]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>

</HEAD>



<BODY style="font-family: Verdana">

<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[Selecciona]</option>
<option value=1>Tierra</option>
<option value=2>Mar</option>
<option value=3>Aire</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">
</SELECT>
<SELECT id=thirdChoice name=thirdChoice>
</SELECT>
</TD>
</TR>
</TABLE>
</form>
hola man.. mira yo utilice este script para unas pruebas y lo almacene en una base de datos.. el problema es que en lugar de almacenarme lo que contiene el string me almacena un numero ??? podrias ayudarme alli?
  #10 (permalink)  
Antiguo 23/03/2009, 01:56
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Respuesta: 3 listas dependientes

El mensaje original es de hace casi 6 años. Por favor, no reviváis temas tan antiguos.

Saludos,
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Tema Cerrado

SíEste tema le ha gustado a 1 personas (incluyéndote)




La zona horaria es GMT -6. Ahora son las 12:46.