I've faced the same problem this week
My solution (using fancybox v1.3.1) add one argument frameName in the
fancybox arguments
in the normal version fancybox-1.3.1.js of the code search for case
'iframe'
replace the following code
case 'iframe' :
$('<iframe id="fancybox-frame" name="fancybox-frame' + new
Date().getTime() + '" frameborder="0" hspace="0" scrolling="' +
selectedOpts.scrolling + '" src="' + selectedOpts.href + '"></
iframe>').appendTo(tmp);
fancybox_show();
break;
by
case 'iframe' :
if(selectedOpts.frameName){
$('<iframe id="fancybox-frame" name="' + selectedOpts.frameName + '"
frameborder="0" hspace="0" scrolling="' + selectedOpts.scrolling + '"
src="' + selectedOpts.href + '"></iframe>').appendTo(tmp);
}
else {
$('<iframe id="fancybox-frame" name="fancybox-frame' + new
Date().getTime() + '" frameborder="0" hspace="0" scrolling="' +
selectedOpts.scrolling + '" src="' + selectedOpts.href + '"></
iframe>').appendTo(tmp);
}
fancybox_show();
break;
Or in the packed version search for
case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+
(new Date).getTime()+'" frameborder="0" hspace="0"
scrolling="'+e.scrolling+'" src="'+e.href+'"></
iframe>').appendTo(m);break;
and replace the code above by
case "iframe":if(e.frameName){b('<iframe id="fancybox-frame"
name="'+e.frameName+'" frameborder="0" hspace="0"
scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m)}
else{b('<iframe id="fancybox-frame" name="petFbFrame" frameborder="0"
hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></
iframe>').appendTo(m);break;}
then in the page containing the form
add a target attributes to your form tag <form....
target="theNameOfYourFancyFrame">
add also the calls to jquery & fancybox (pointing to the modified
fancybox library packed version or not as like)
<script language="javascript">
$(document).ready(function() {
$("#aPostSample").fancybox({
'width' : '95%',
'height' : '95%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe',
'frameName' : 'theNameOfYourFancyFrame',
'onComplete':function (){$('#form_cart').submit();}
});
})
</script>
Note the new argument frameName added in the script matching the name
of the frame mentionned in the target attributes or the form tag
I use one hidden anchor tag in my code
<a id="aPostSample" href="#"></a>
Your submit button must be replaced by <input type="button"
name="cart_submit" id="cart_submit"
value="Subscribe" onClick="$('#aPostSample').trigger('click');" />
Hope it helps
JM Brussels Belgium
On 4 mai, 08:46, Nagarajan <
nagakredd...@gmail.com> wrote:
> Hi,
>
> I have a form in my base document(body) and it has some form element
> with submit button. What I really need is, When I click on the submit
> button I need to post all my content into my Fancybox. I have tried
> all possible way to get the form values but I am not able to get the
> values in fancybox. It actually open separate window and fancybox
> shows empty page. Sample code is below,
>
> <form name="form_cart" id=""form_cart" action="/test.php"
> method="post">
> <input type="hidden" value="
n...@mail.com" name="email" id="email" />