Popup on form submit

Anonymous
Not applicable

Popup on form submit

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
Tags (1)
2 REPLIES 2
Kenny_Elkington
Marketo Employee

Re: Popup on form submit

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;
});
Anonymous
Not applicable

Re: Popup on form submit

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