Skip to content Skip to sidebar Skip to footer

How Do I Reload Fancybox Iframe Form With Errors In Flask

In Flask have an iframe display a login form with fancybox and it works fine, but if there is an error I want to reload the form. The problem is when I submit the form with errors,

Solution 1:

After lots of experiments I finally figured it out.

functionsend_ajax(e){
    $.ajax({ type : "POST",
        cache : false,
        url: "/signin",
        data: $(this).serialize(),
        success:function(data)
        {   
            parent.jQuery.fancybox(data);
        }
    });

    returnfalse;       
}

$("#sign-in-form").on( "submit", send_ajax ); 

There is only one problem with this. If you enter the wrong password twice, the second window does not appear.

Post a Comment for "How Do I Reload Fancybox Iframe Form With Errors In Flask"