Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/05/2010, 05:44
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: Error al ocultar y mostrar un form

Hola

Cita:
Iniciado por zerokilled Ver Mensaje
  • en iexplorer no puedes cambiar el tipo de un elemento INPUT. ¡una gran pena! para lograr algo similar tendrias que crear un nuevo elemento INPUT y declarar el tipo antes de agregarlo al documento.
Ahh mira, no lo sabía

Prueba a usar DOM

Código Javascript:
Ver original
  1. function mostrarForm(id){
  2.     document.getElementById('f_'+id).value = document.getElementById(id).innerHTML;
  3.     document.getElementById('f_'+id).style.display = "block";
  4. }
  5.  
  6.  
  7. function ocultaForm(id){
  8. document.getElementById(id.split('_')[1]+'_'+id.split('_')[2]).innerHTML = document.getElementById(id).value;
  9. document.getElementById(id).style.display = "none";
  10. }

Código HTML:
Ver original
  1. <div id="nombre_mod" onclick="mostrarForm(this.id);">Nombre del modulo</div><input type="text" id="f_nombre_mod" style="display:none;" value="" onblur="ocultaForm(this.id);" />

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />