Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2012, 18:58
isabelramirezmontoya
 
Fecha de Ingreso: noviembre-2010
Mensajes: 204
Antigüedad: 13 años, 5 meses
Puntos: 1
Problema con ventana modal

Buenas tardes

Chicos les pido por favor una mano con el siguiente problema que tengo y que no he podido solucionar.

Tengo una pagina y dentro de la pagina un formulario en una ventana modal, el formulario y la pagina funcionan de forma aceptable, sin embargo cuando envio el formulario que esta dentro de la pagina, el browser se maximiza en la pantalla con la accion a ejecutar del formulario (enviarmensaje.php) y se bloquea.

Como hago para que luego de enviar el formulario dentro de la misma ventana modal del formulario me genere un mensaje que diga formulario enviado con exito y un boton para cerrar la ventana modal.

El codigo que estoy usando es el siguiente:

<html>

<head>
<title>MI PAGINA</title>
</head>

<body>

<script type="text/javascript">

function mostrarVentana()
{
var ventana = document.getElementById('iniciarsesion'); // Accedemos al contenedor
ventana.style.marginTop = "10px"; // Definimos su posición vertical. La ponemos fija para simplificar el código
ventana.style.marginLeft = ((document.body.clientWidth-450) / 2) + "px"; // Definimos su posición horizontal
ventana.style.display = 'block'; // visible
}

function ocultarVentana()
{
var ventana = document.getElementById('iniciarsesion'); // Accedemos al contenedor
ventana.style.display = 'none'; // invisible
}

</script>



<a href="javascript:mostrarVentana();">Ventana modal con formulario</a>


<div id="iniciarsesion" style="position: fixed; width: 550px; height: 530px; top: 0; left: 0; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; border: #333333 1px solid; background-color: #FAFAFA; color: #000000; display:none;">
<div style="font-weight: bold; text-align: left; color: #FFFFFF; padding: 5px; background-color:#006394">Contactenos</div>

<html>

<head>
<title>Formulario</title>
</head>


<body>


<div class="box1">
<div class="box2">
<form class="form2" method="post" action="enviarmensaje.php" name="frm2" onSubmit="return Verificar1()" target='_self' enctype="multipart/form-data">
<table border="0" cellspacing="5" width="100%">
<tr>
<td width="20%" align="right"><b>Nombre:</b></td>
<td width="80%" align="left"><input type="text" name="nombre" size="57" maxlength="40"></td>
</tr>
<tr>
<td width="20%" align="right"><b>E-mail:</b></td>
<td width="80%" align="left"><input type="text" name="email" size="57"></td>
</tr>
<tr>
<td width="20%" align="right"><b>Asunto:</b></td>
<td width="80%" align="left"><input type="text" name="asunto" size="57"></td>
</tr>
<tr>
<td width="20%" align="right"><b>Archivo:</b></td>
<td width="80%" align="left"><input type="file" name="archivo" size="43"></td>
</tr>
<tr>
<td width="20%" align="right"><b>Mensaje:</b></td>
<td width="80%" align="left"><textarea name="mensaje" cols="43" rows="5"></textarea>
</td>
</tr>
<tr>
<td width="100%" colspan="2"><p class="p13"><input type="submit" value=" Enviar "><input type="reset" value=" Borrar "></p></td>
</tr>
</table>
</form>
</div>

<div style="padding: 10px; text-align: center; margin-top: 4px;"><input id="btnAceptar" onclick="ocultarVentana1();" name="btnAceptar" size="20" type="button" value=" Cerrar " />
</div>

</div>

</body>
</html>

</div>

</body>
</html>

Gracias por su tiempo

Isabel