• So I have this little form that collects user’s email address and then I have this amazingly clever redirect that goes to another page and automatically fills in email value in a different, larger form:

    on_sent_ok: "var datmail = $('.wpcf7 input[name=regemail]').val();location.replace('https://domain/page/?regemail='+datmail+'');"

    And this generally works like a charm. Until I tried to call form shortcode in popup (I’m using Popups 1.3.3). Form executes, redirect works, everything looks fine, it’s just field value is no longer acquired and passed. How so?

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Hi!
    It may be too little too late, but I had the exact same problem and this is the ONLY place I ever found a reference to it.

    My situation is a little different, as I am using Popup Maker, but perhaps my solution will help. It’s stupidly easy (in my case) and I spent too much time figuring it out…

    So, it’s this: just add the ID of your popup before the ID of your input.

    Here’s my code. It closes the popup, redirects, writes to console and sets a cookie.

    // Replace form_7 with the # of your form to ensure
            function _cf7_form_7_on_sent_ok_() {
    			jQuery('#popmake-5669').trigger('popmakeSetCookie');
    
    			var email = jQuery('#popmake-5669 #email').val();
    
    			console.log(email);
    
    			/**
    			* Close the popup after a 5 second delay.
    			*/
    			setTimeout(function () {
    				jQuery('#popmake-5669').popmake('close');
    				location = 'https://beta.bootprints.com/local-edition-signup/?email='+email;
    			}, 5000); // 5 seconds
    
            }

    And then, for on_sent_ok i just call the function, which lives in my functions file and gets added to wp_footer.

    That’s it. I hope this helps someone.

Viewing 1 replies (of 1 total)
  • The topic ‘Passing field value does not work when form is executed in popup’ is closed to new replies.