Q:

Javascript form is not able to submit as expected on Internet explorer

I have a function that creates a form in javascript and submits it.  It works as expected in Safari, Chrome, FF, & Opera but not IE 10. 
When the from submits the browser is not pointed to the url in the action attribute in IE.  I'm sure this is lame but I can't find the problem so any help would be greatly appreciated. 
function checkout() {
    var myDoc = 'some xml data to send'
    var form = document.createElement("form");
    form.setAttribute( "method", "POST" );
    form.setAttribute( "action", "http://domain.com/script.php" );
    var hiddenField = document.createElement("input");
    hiddenField.setAttribute( "type", "hidden" );
    hiddenField.setAttribute( "name", "myField" );
    hiddenField.setAttribute( "value", myDoc );
    form.appendChild(hiddenField);
    form.submit();
}

Thanks for any help!!! 

A:

On Internet Explorer you have to append the form to the document (I don't know if it's a bug or a feature). 
Simply do
form.style.display = 'none'; // useful if you're targeting another window
document.body.appendChild(form);

