Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/07/2008, 19:33
pixel1
 
Fecha de Ingreso: julio-2008
Ubicación: México
Mensajes: 150
Antigüedad: 16 años, 7 meses
Puntos: 4
Respuesta: mostrar formulario con javascript

Bueno el asunto es relativamente sencillo, tal vez existan mejores soluciones pero aqui te dejo una:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<script language="javascript">
function mostrarFormulario(id)
{
	var contenedor=document.getElementById(id);
	contenedor.style.display="block";
}
</script>
</head>

<body>
<table width="46%" border="0" cellspacing="4" cellpadding="2">
  <tr>
    <td><input type="submit" name="button" id="button" value="Crear usuario" onclick="mostrarFormulario('contenedor');"/>
    <input type="submit" name="button2" id="button2" value="Actualizar" /></td>
  </tr>
  <tr>
    <td>
    <div style="display:none" id="contenedor">
    <table width="100%" border="0" cellspacing="4" cellpadding="2">
      <tr>
        <td>FORMULARIO</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </div>
    </td>
  </tr>
</table>
</body>
</html> 
Si observas detenidamente, el boton Crear Usuario manda llamar una funcion en javascript que hace que el div con el id "contenedor" sea visible.

Saludos.