我有一个jsp,即customer.jsp,我用下面的代码片段打开弹出窗口
window.open('customerSuccess.jsp','customer', 'height=600,width=900,top=30,left=50,resizable=yes,menubar,scrollbars');
document.forms[formName].action="../customer.do"
document.forms[formName].target="customer";
这将打开 CustomerSuccess.jsp,它具有在单击一个按钮时调用的函数 buttonClicked。CustomerSuccess.jsp 具有名称为 Department 的表单
function buttonClicked() {
document.forms['Department'].file.value = '459';
document.forms['Department'].submit();
}
我的问题是提交父窗口页面而不是弹出窗口。我不明白为什么它不提交弹出 html 表单?
我尝试了什么:-我还尝试在提交表单之前获取表单的长度。长度出来是1,名字是Department
var theForms = document.getElementsByTagName("form");
for(i=0; i<theForms.length; i++)
alert(theForms[i].name);