2011-06-14 97 views
0

这真的很奇怪,它不应该以这种方式发生,但它是。提交后避免fancybox iframe关闭?

我打电话给我的FB:

<p>Haz <a class="recupera" href="recover.php">click aquí</a> si has olvidado tu contraseña.</p> 

$("a.recupera").fancybox({ 
     'scrolling'  : 'no', 
     'titleShow'  : false 
    }); 

里面recover.php我有一个表格,我处理一切在那里,它的工作原理,当我在浏览器中打开它,并尽一切罚款:

<? 
//DOCTYPE and all that jazz here 
if(!empty($_POST['email'])){ 

//does stuff in DB 

}else{ 
?> 
<div id="logeando"> 
<h2 class="titulo-cufon">Recuperar contraseña</h2> 
<form method="post" action="" id="loginform"> 
<fieldset> 
    <label class="titulo-cufon" for="email">E-mail:</label> 
    <input type="text" name="email" id="email" /><br /> 

    <input type="submit" name="register" id="register" class="large button gray input" value="Enviar" /> 
</fieldset> 
</form> 
</div> 
<?}?> 

每次我点击提交按钮我的fancybox将关闭。这是一个iframe,它为什么要这样做?我怎样才能防止它?这是我的提交而不是关闭它?从我读到的,人们通常会要求oposite(iframe在提交后关闭,而不是阻止它)

+0

尝试将返回false; – 2011-06-14 12:44:43

+0

我把它放在哪里? – 2011-06-14 13:28:39

回答

2

指定fancybox正在iframe中运行。

$("a.recupera").fancybox({ 
     'scrolling'  : 'no', 
     'titleShow'  : false, 
     'type'  : 'iframe' 
    }); 
+0

非常感谢,这工作! – 2011-06-16 07:57:46