submit form to fancybox
Для $_GET
$(".add_to_cart_form").submit(function(){ $form=$(this); $.fancybox({ 'title':"form submission", 'href':$form.attr("action")+"?"+$form.serialize(), 'type':'ajax' }); return false; });
Для $_POST
$(".details_form").submit(function(){ $form=$(this); $.ajax({ url:$form.attr("action"), type:'POST', dataType:'html', data:$form.serialize(), beforeSend:function(){$.fancybox.showLoading();}, success:function(data,textStatus,xhr){ $.fancybox({ 'content':data }); }, error:function(xhr,textStatus,errorThrown){ alert("An error occurred."); }, complete:function(){$.fancybox.hideLoading();} }); return false; });
http://stackoverflow.com/questions/6006201/how-do-i-submit-the-data-of-a-form-to-an-iframe-in-fancybox