Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/08/2005, 19:09
Avatar de affv
affv
 
Fecha de Ingreso: diciembre-2002
Ubicación: Ahora aqui
Mensajes: 485
Antigüedad: 22 años, 4 meses
Puntos: 0
Lista dependiente con un input text

ok necesito hacer una lista dependiente con la siguiente cualidad.
1 Comidas
1.1 Arroz
1.2 Pan
1.3 Tortilla
2 Bebidas
2.1 Pepsi
2.2 Coca
3.3 Natural
3 Otros
1.1 <input type="text" name="T1" size="20">
(esto para que la ultima opcion pueda ser variable.)

El codigo que utilizo para hacer la lista variable es este
Código HTML:
<html>

<head>
<title></title>
<script languaje="JavaScript">
<!--
Informacion = new Array();
Informacion[0] = new Array();
Informacion[1] = new Array('Arroz','Pan','Tortilla');
Informacion[2] = new Array('Pepsi','Coca','Natural');
Informacion[3] = new Array('Aqui debe de mostrar el input en lugar de este select');

function cambiar(formulario){
var i = 0;
var select1 = formulario['Seleccion'];
var select2 = formulario['Opcion'];
var vector = Informacion[select1.selectedIndex];
if(vector.length)select2.length=vector.length;
while(vector[i]){
select2.options[i].value = vector[i];
select2.options[i].text = vector[i];
i++;
}
select2.options[0].selected = 1;
}
-->
</script>
</head>

<body>
<form name="MyForm">
	<select name="Seleccion" onchange="cambiar(this.form)" class="Textbox">
		<option>-</option>
		<option>Comidas</option>
		<option>Bebidas</option>
		<option>Otros</option>
	</select>
	<select name="Opcion" class="Textbox">
		<option>-</option>
	</select>
</form>
</body>

</html> 
__________________
Todo tiene un comienzo y un fin!!
Postea tus proyectos