Trying to use magnific popup
for a one page site and have the forms show as needed.
Calling the external file popup like so.
<a href="myformx.php" class="simple-ajax-iframe">form</a>
<script type="text/javascript">
$(document).ready(function(){
$('.simple-ajax-iframe').magnificPopup({
type: 'iframe'
});
$('.simple-ajax-popup').magnificPopup({
type: 'ajax'
});
});
</script>
<form name="form1" method="POST" action="myformx.php">
<label>Your first name:</label>
<input class="formfield" name="your_name" type="text" value="" size="20">
<input class="submit" type="image"
id="Submit" name="Submit" value="Submit"
src="images/but_send.jpg"
style="width: 97px; height: 51px;">
Form pops - awesome… Form submission blanks out to nothing - not awesome.
Looking to determine how to get this to better submit to itself in the popup window. Have tried several possibilities - none effectively. Cant be that difficult - I'm missing the obvious here somehow.
Resolved. Used this to manipulate and name the form out. Note name="my_form". Used target="my_form" on the form tag to get the post vars to submit to itself. Hope this helps someone out.
$('.simple-ajax-iframe').magnificPopup({
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" name="myform" frameborder="0" allowfullscreen> </iframe>'+
'</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button
}