Skip to main content
November 19, 2014
Question

Popup on form submit

  • November 19, 2014
  • 2 replies
  • 1744 views
How do I create a popup window when a form is submitted, only when a checkbox is checked?

I have this but it's not working

<script type="text/javascript">   
var $jQ = jQuery.noConflict();
$jQ(function() {
    $jQ(".mktoButtonWrap button").click(function(){
        if(document.getElementById('signUpToPartnerEdge').checked){     
            event.preventDefault();
            window.open("https://arubanetworkskb.secure.force.com/prm/PartnerApplication", "PopupWindow", "width=600,height=600,scrollbars=yes,resizable=no");
        }else{ }
        return false;           
    });
});
</script>


thanks
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Kenny_Elkington
Adobe Employee
Adobe Employee
November 19, 2014
Hey Ralph,

Your if statement probably isn't evaluating correctly.  I would switch to using the onSubmit callback(http://developers.marketo.com/documentation/websites/forms-2-0/) for this like this:

MktoForms2.onSubmit( function(form){
if(form.vals.signUpToPartnerEdge){
window.open("https://arubanetworkskb.secure.force.com/prm/PartnerApplication", "PopupWindow", "width=600,height=600,scrollbars=yes,resizable=no");
return false;
});
November 19, 2014
Thanks for the reply. I have dropped the script on the page:
http://page.arubanetworks.com/MidMarket.html

However, my console still says "Uncaught Uncaught TypeError: undefined is not a function MidMarket.html:283(anonymous function)"

And the popup still doesn't come up. Any ideas why?

thanks