Forms stuck on "Please Wait" in IE 11 only

Anonymous
Not applicable

Forms stuck on "Please Wait" in IE 11 only

The forms will not submit in IE 11, they get hung up on "Please Wait"

please-wait-error.png

I get the following javascript error: SCRIPT438: Object doesn't support property or method 'remove' - referring to the line in bold. This error only occurs in IE.

function(form){

  var mktoForm = document.getElementById('mktoForm_1019'),

      formSuccess = document.getElementById('form_success_1019');

  mktoForm.querySelector('style').remove();

  form.onSuccess(function(){

    formSuccess.innerHTML = "Thanks for your submission!";

    mktoForm.setAttribute("style", "visibility: hidden; position: absolute;");

    return false;

  }); 

});

Has anyone every experienced this before? Or have some idea on how to fix it?

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Forms stuck on "Please Wait" in IE 11 only

This isn't a Forms 2.0 problem.

You obviously can't call DOM methods that aren't supported cross-browser. (And it's not just IE 11, it's IE 8, 9, 10, and 11.)

Use

  var styleEl = mktoForm.querySelector('style');

  styleEl.parentNode.removeChild(styleEl);

Also I'm not sure why you're removing a <style> element.  There are always better ways to use the CSSOM.