AnsweredAssumed Answered

Forms 2.0 on Wordpress not submitting consistently

Question asked by Ellen Trieu on Sep 7, 2018
Latest reply on Sep 10, 2018 by Ariel Sasso

Hi Marketo Community!

 

My website uses Wordpress and we embed Marketo forms 2.0 with some extra scripts to cookie the user after a form is submitted. This was working perfectly for a year, however, two weeks ago one of our embedded Marketo forms started to not submit consistently. Sometimes it submits and everything works and other times the user would be stuck on the form page with the button saying "Please Wait" grayed out. This causes problems for us because the Marketo form needs to submit so the cookies can be set for the user to continue to the next step in their trial.

 

We spoke with Markteo support and they don't know what the problem is so here's my cry for help. "HELLLPPPP!!!"

 

The script we're using with the form is provide in Marketo's Documentation (http://developers.marketo.com/javascript-api/forms/).

 

Here's the page we're having trouble with: https://www.scylladb.com/test-drive/ https://www.scylladb.com/test-drive/

And here's our form script...Any guidance on how to fix this is much appreciated. Thank you!

 

    <form id="mktoForm_1114"></form>
    <script>
        (function() {
            if (typeof(MktoForms2) === 'undefined') {
                document.getElementById('mktoForm_1114').innerHTML = '<div style="padding-bottom: 20px; color: #ccc; font-style: italic">Form blocked - please disable any privacy plugins and reload the page in order to complete your registration (Privacy Badger, Adblock, etc)</div>'
            }
            else {

                MktoForms2.loadForm("//app-ab17.marketo.com", "791-QBF-350", 1114);

                MktoForms2.whenReady(function (form){


                 //Add an onSuccess handler
                  form.onSuccess(function(values, followUpUrl){
                    var email = jQuery('input[name=Email]').val();
                    var email_hash = jQuery('input[name=Email]').val() + '_3qrw56fyi30aeau';
                    email_hash = jQuery.md5(email_hash);
                    var name = jQuery('input[name=FirstName]').val() + ' ' + jQuery('input[name=LastName]').val();
                    var company = jQuery('input[name=Company]').val();
                    setCookie('email', email, 3650);
                    setCookie('email_hash', email_hash, 3650);
                    setCookie('name', name, 3650);
                    setCookie('company', company, 3650);
                    location.href = "/test-drive-thanks/";
                    return false;
                });
            });
        }
    })();
</script>

Outcomes