Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/09/2008, 07:11
shembao
 
Fecha de Ingreso: febrero-2008
Mensajes: 73
Antigüedad: 16 años, 2 meses
Puntos: 0
como mostrar y ocultar dependiendo del select

holas ... quiisiera saber como ocultar y mostrar una table dependiendo del select (en este caso si elige fecha se debe desplegar la tabla oculta) ... este es el codigo que tengo ... trate de hacerlo con css y xDisplay pero nada ...
a ver si me ayudan ... gracias

Código:
<head>
<script>
function expandir_formulario(){
if (document.busca.opcion.selected==3){
   xDisplay('capaexpansion', 'block')
}else{
   xDisplay('capaexpansion', 'none')
}
} 
</script>
</head>

<body>

elseif($op==2){ ?>
    <h2>Consultas</h2>
    <br/>

    <br/>
    <form name="busca" method="post" action="formulario.php?op=2">
	<table width="80%" height="30" border="0" cellspacing="1">
      <tr valign="top">
          <td width="8%">Buscar</td>
          <td width="25%"><input type="text" name="buscar" size="30" /></td>
          <td width="5%"></td>
          <td width="62%" >

            <select name="opcion">
              <option value="0">&nbsp;</option>
              <option value="1" >Nro. Contenedor</option>
              <option value="2" >Nro. Documento</option>
              <option value="3" onclick="expandir_formulario()">Fecha</option>
            </select>
			
            <input type="submit" name="Button1" value="Ir" />
          </td>        
      </tr>
    </table>
    <br/>
   <div id=capaexpansion> 
      <table id="fecha"  width="66%" border="0" cellspacing="0">
        <tr>
          <td width="9%"> Inicio </td>
          <td width="36%"><input type="text" id="inicio" name="inicio"/>
            <button id="buttoninicio" >...</button></td>
          <td width="6%">Fin </td>
          <td width="39%"><input type="text" id="fin" name="fin"/>
            <button id="buttonfin"  >...</button></td>
        </tr>
    </table>

<body>
ahora si tieben otras sugerencias ,,, = sirven ... gracias