Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/08/2005, 09:33
Avatar de MarioNunes
MarioNunes
 
Fecha de Ingreso: agosto-2005
Mensajes: 280
Antigüedad: 19 años, 1 mes
Puntos: 1
A ver con esto que tal:

Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Prueba</title>
</head>

<body>
<script language="javascript" type="text/javascript">

function slctr(texto,valor){
this.texto = texto
this.valor = valor
}
var empresa=new Array()
empresa[0] = new slctr('- - Seleccionar - -')
empresa[1] = new slctr("Documento",'0')
empresa[2] = new slctr("CIF",'1')

var trabajadores=new Array()
trabajadores[0] = new slctr('- Selecciona -')
trabajadores[1] = new slctr("Documento",'2')
trabajadores[2] = new slctr("NIF",'3')


function slctryole(cual,donde){
if(cual.selectedIndex != 0){
   donde.length=0
   cual = eval(cual.value)
   for(m=0;m<cual.length;m++){
      var nuevaOpcion = new Option(cual[m].texto);
      donde.options[m] = nuevaOpcion;
      if(cual[m].valor != null){
         donde.options[m].value = cual[m].valor
         }
      else{

          donde.options[m].value = cual[m].texto

         }
      }
   }
}

</script>

<form name="filtro" method="post" action="">
   <select name="select" onchange="slctryole(this,this.form.select2)">
    <option>- - Seleccionar - -</option>

    <option value="empresa">Empresa</option>
    <option value="trabajadores">Trabajadores</option>
  </select>
  <select name="select2">
    <option>- - - - - -</option>
  </select>
 </form>

</body>
</html> 
Un saludo.
__________________
www.pensandoenred.com