Javascript 如何使用struts 1.2中的java脚本在showmodelgialoge中将值从子页面传递到父页面
当单击boo按钮时,打开showmodeldialoge并检查showmodeldialoge中的某些行,当按foo按钮无法从子页面获取值并传递到父页面时 父页面代码:Javascript 如何使用struts 1.2中的java脚本在showmodelgialoge中将值从子页面传递到父页面,javascript,jquery,struts-1,Javascript,Jquery,Struts 1,当单击boo按钮时,打开showmodeldialoge并检查showmodeldialoge中的某些行,当按foo按钮无法从子页面获取值并传递到父页面时 父页面代码: function explain() { //newwin = window.open('domain.do?method=showBranchForm','newwin'); var a='domain.do?method=showBranchForm'; window.showModalDialog(a, self, 's
function explain() {
//newwin = window.open('domain.do?method=showBranchForm','newwin');
var a='domain.do?method=showBranchForm';
window.showModalDialog(a, self, 'status:no;resizable:yes;help:no;scroll:yes;width:1300;height:600');
}
<input <%=branchEnable%> class="btn"
style="width: 120px" value="boo" type="button"
onclick="explain();" />
函数解释(){
//newwin=window.open('domain.do?method=showBranchForm','newwin');
var a='domain.do?method=showBranchForm';
showModalDialog(一个,self,'状态:否;可调整大小:是;帮助:否;滚动:是;宽度:1300;高度:600');
}
子值应显示在此处:
<select id="listbranch"
multiple="multiple" size="8" name="listbranch"
style="width: 200px; font-family: tahoma; font-size: 16"/>
这是子页面:
<script language="javascript" type="text/javascript">
function TransferData()
{
opener.window.document.forms[0].elements['listbranch'].length=0;
counter=0;
document.forms.newform.elements
for(i=0; i<document.forms[0].elements.length; i++)
{
if(document.forms[0].elements[i].type=="checkbox")
{
if(document.forms[0].elements[i].checked==true)
{
opener.window.addOption(document.forms[0].elements[i].value,document.forms[0].elements[i].id,counter);
counter++;
}
}
}
window.close();
}
</script>
<tbody>
<%
if(branchsIterator != null){
while(branchsIterator.hasNext()){
Branch t = branchsIterator.next();
%>
<tr>
<td><input type="checkbox" id="<%=t.getBranchCode()%>" value="<%=t.getBranchName() %>"/></td>
<td ><%=t.getBranchName() %></td>
<td><%=t.getBranchCode() %></td>
</tr>
<%}
}
%>
</tbody>
<input class="btn" type="button" value="اfoo" style="width:200px" onclick="TransferData();" />
函数TransferData()
{
opener.window.document.forms[0]。元素['listbranch']。长度=0;
计数器=0;
document.forms.newform.elements
对于(i=0;i
您称之为子页面的是div还是其他页面