Ou voici une autre soluc ou je cree dynamiquement un formulaire :
function openWindowWithPost(url, name, keys, values, width, height) {
if (isLogDebugEnabled(LOGGER_NAME)) {
logDebug(LOGGER_NAME, "Entre la methode javascript openWindowWithPost() with parametres : " + url + " " + name + " " + keys + " " + values + " " + width + " " + height);
}
var html = "";
html += "<html><head></head><body><form id='formid' method='post' action='" + url + "'>";
if (keys && values && (keys.length == values.length))
for (var i=0; i < keys.length; i++)
html += "<input type='hidden' name='" + keys[i] + "' value='" + values[i] + "'/>";
html += "</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";
console.log(html);
var newWindow = window.open('', name, "width=" + width + ",height=" + height + ",resizable=1");
if (!newWindow) return false;
newWindow.document.write(html);
return newWindow;
}
=> MaEl <=
|