2011-06-14 80 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