Skip to content

Instantly share code, notes, and snippets.

@danieliser
Last active July 14, 2022 22:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieliser/76b40539359b49bec4607eb3a0e9019d to your computer and use it in GitHub Desktop.
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.
(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