开发者

avoid fancybox iframe closing after submit?

This is really weird and it's not supposed to be happening this way but it is.

I call my 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
    });

Inside recover.php I have a form and I handle everything there, it works when I open it in a browser and does everything fine:

<?
//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>
 <?}?>

Everytime I click the submit button my fancybox will close. It's an iframe, why would it do that? How can I prevent it? Is it my submit buton closing it? From what I've read, people are usually asking for the oposite (the iframe closing after submit, not pr开发者_运维问答eventing it)


Specify that fancybox is running in an iframe.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜