Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/09/2007, 15:45
reimonfranco
 
Fecha de Ingreso: febrero-2006
Mensajes: 858
Antigüedad: 18 años, 9 meses
Puntos: 4
Re: Necesito una mano, please

Mira este codigo:

Cita:
<html>
<title>Javascript 2</title>
<script lenguage='javascript'>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}



function agregarOpciones(form)
{
var selec = form.s1.options;
var combo = form.s2.options;
combo.length = null;

if (selec[0].selected == true)
{
var seleccionar = new Option("Seleccione un rango","","","");
combo[0] = seleccionar;
}

if (selec[1].selected == true) {
var oo = new Option("Seleccione un rango","","","");
var o1 = new Option("Todos","casas.htm","","");
var o2 = new Option("300,000 a 650,000","http://google.com","","");
var o3 = new Option("601,000 a 950,000","http://tacoketo.com","","");
var o4 = new Option("951,000 a 1,500,000","http://tonterias.com","","");
var o5 = new Option("1,500,000 en adelante","http://gusanito.com","","");
combo[0] = oo;
combo[1] = o1;
combo[2] = o2;
combo[3] = o3;
combo[4] = o4;
combo[5] = o4;
}

if (selec[2].selected == true) {
var o1 = new Option("Todos","1","","");
var o2 = new Option("300,000 a 650,000","2","","");
var o3 = new Option("601,000 a 950,000","3","","");
var o4 = new Option("951,000 a 1,500,000","4","","");
var o5 = new Option("1,500,000 en adelante","5","","");
combo[0] = o1;
combo[1] = o2;
combo[2] = o3;
combo[3] = o4;
combo[4] = o5;
}
if (selec[3].selected == true) {
var o1 = new Option("Todos","1","","");
var o2 = new Option("300,000 a 650,000","2","","");
var o3 = new Option("601,000 a 950,000","3","","");
var o4 = new Option("951,000 a 1,500,000","4","","");
var o5 = new Option("1,500,000 en adelante","5","","");
combo[0] = o1;
combo[1] = o2;
combo[2] = o3;
combo[3] = o4;
combo[4] = o5;
}
if (selec[4].selected == true) {
var o1 = new Option("Todos","1","","");
var o2 = new Option("300,000 a 650,000","2","","");
var o3 = new Option("601,000 a 950,000","3","","");
var o4 = new Option("951,000 a 1,500,000","4","","");
var o5 = new Option("1,500,000 en adelante","5","","");
combo[0] = o1;
combo[1] = o2;
combo[2] = o3;
combo[3] = o4;
combo[4] = o5;
}
if (selec[5].selected == true) {
var o1 = new Option("Todos","1","","");
var o2 = new Option("300,000 a 650,000","2","","");
var o3 = new Option("601,000 a 950,000","3","","");
var o4 = new Option("951,000 a 1,500,000","4","","");
var o5 = new Option("1,500,000 en adelante","5","","");
combo[0] = o1;
combo[1] = o2;
combo[2] = o3;
combo[3] = o4;
combo[4] = o5;
}

}
// -->
</script>
</head>
<body>
<form name="frm">
<select name="s1" onChange="agregarOpciones(this.form)">
<option value="">[Selecciona el tipo de propiedad que desea buscar]</option>
<option value="casas">Casas</option>
<option value="terrenos">Terrenos</option>
<option value="deptos">Departamentos</option>
<option value="locales">Locales</option>
<option value="bodegas">Bodegas</option>
</select>

<select name="s2" onChange="MM_jumpMenu('parent',this,0)">
<option value=""> Seleccione un rango </option>
</select>
</form>
</body>
</html>
saludos
__________________
*La amistad se multiplica cuando se divide*

Última edición por reimonfranco; 06/09/2007 a las 15:51