codice:
var MyForm = document.createElement("form"); 
    MyForm.method = method; 
    MyForm.action = path;
MyForm.enctype = "multipart/form-data";
 
    for(var key in params) { 
        if(params.hasOwnProperty(key)) { 
            var hiddenField = document.createElement("input"); 
            hiddenField.type = "hidden"; 
            hiddenField.name = key; 
            hiddenField.value = params[key]; 
         
            MyForm.appendChild(hiddenField); 
         } 
    }    
    document.body.appendChild(MyForm); 
    MyForm.submit();
}
Ho cambiato la variabile form che è una parola riservata e ho impostato gli attributi direttamente (più compatibile con le varie versioni dei browser)
Se non funziona abbandonerei il dom e inserirei il form (in html) in un div con display:none che mostreri all'occorenza