Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/01/2006, 09:38
hdssegado
 
Fecha de Ingreso: diciembre-2005
Mensajes: 25
Antigüedad: 18 años, 5 meses
Puntos: 0
ocultar y mostrar getElementById

Hola, tengo un select en un formulario con dos opciones:
Código:
  <html:select property="filtrar" onchange="javascript:cambiar()">
     <option  id="contrato" >Contrato</option>
     <option  id="cliente">Cliente</option>
  </html:select>
y necesito q se me oculte cuando seleccione Cliente una caja de texto q tengo mas abajo:
Código:
  <tr id="ocultar">
     <td><SPAN id="anuncio">Estado</SPAN></td>
     <td><html:text property="estado" ></html:text></td>
  </tr>
he exo una funcion q esta mal q m la oculta pero luego cuando vuelvo a selecconar Contrato no m la vuelve a mostrar, este es es script:
Código:
 
     function cambiar(){
        if (document.getElementById("contrato").value){
            document.getElementById("ocultar").style.visibility="visible";
        }
        else{
            document.getElementById("ocultar").style.visibility="hidden";
        }
      }
alguien me puede ayudar por favor?