Open Fancybox (or equiv) from Form input type=“submit”

后端 未结 9 1367
无人及你
无人及你 2020-12-01 07:10

is there a way to get a fancybox (http://fancy.klade.lv/) or any other lightbox from submitting a FORM (with an image button)?

HTML looks like this:

         


        
9条回答
  •  有刺的猬
    2020-12-01 07:44

    I just had to do this. Here's how I went about it.

    $('#elementid').fancybox({
       onStart : function() {
          $.post($(this).attr('href'), $('#formid').serialize());
       }
    });
    

    That way you can submit the form and call the fancybox all in one shot. It does submit the form ajax style. The "submit" button needs to be in an tag.

    Hope that helps.

提交回复
热议问题