Background submission not working on Windows browsers

Bruce_Bailey
Level 1

Background submission not working on Windows browsers

I have the background submission code working on a Mac... works great on all browsers. Had a few users test it on Windows and it won't work on any browser on a Windows machine, but continues to work on OSX. Can anyone see what I have in here would not be Windows friendly? I put some alerts in to test and it does not appear to be even firing this code.

<script src="//app-ab15.marketo.com/js/forms2/js/forms2.min.js"></script>

<script>

MktoForms2.loadForm("//app-ab15.marketo.com", "110-GBK-123", 1081);

MktoForms2.whenReady(function(mktoForm) {

$('.form-submit').click(function(){$(customFormData.formSelector).submit();});

var customFormData = {

formSelector : '#frm35F472E0-96B1-3589-E76F56B84176EDBD',

fieldMap : [

{

marketo : 'FirstName',

custom : '#field-firstname'

},

{

marketo : 'LastName',

custom : '#field-lastname'

},

{

marketo : 'Email',

custom : '#field-email'

},

{

marketo : 'Company',

custom : '#field-company'

}

]

}

$(customFormData.formSelector).submit(function(e) {

var customForm = e.target,

mktoFields = {};

// iterate over fields on custom form to create MktoForms-compat object

customFormData.fieldMap.forEach(function(field){

mktoFields[field.marketo] = customForm.querySelector(field.custom).value

});

// add to Marketo form

mktoForm.addHiddenFields(mktoFields);

// submit Marketo form

mktoForm.submit();

// stop custom HTML form submission

e.preventDefault();

});

});

</script>

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Background submission not working on Windows browsers

"Windows browsers" isn't really a class of browser anymore.

Can you

  1. tell me an exact browser + version in which this reproducibly fails
  2. provide a test URL
  3. highlight your code so it's readable

https://s3.amazonaws.com/blog-images-teknkl-com/syntax_highlighter.gif