Last active
July 14, 2022 22:58
-
-
Save danieliser/76b40539359b49bec4607eb3a0e9019d to your computer and use it in GitHub Desktop.
Use this to convert form values into a url, then change the iFrame src inside a Popup Maker popup, before opening the popup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($, document) { | |
// Customize these variables. | |
// ---------------------------------- | |
var popupID = 123, | |
form = $('#form'), | |
// ------------------------------ | |
// End Customizations. | |
baseURL = form.attr('action'), | |
popup = $('#pum-' + popupID), | |
iframe = popup.find('iframe').eq(0); | |
$(form).on('submit', function (e) { | |
var querystring = form.serialize(); | |
e.preventDefault(); | |
iframe.attr('src', baseURL + "?" + querystring); | |
popup.popmake('open'); | |
}); | |
}(jQuery, document)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment