当前位置: 代码迷 >> Web前端 >> window.showModalDialogSelect标签返回值有关问题
  详细解决方案

window.showModalDialogSelect标签返回值有关问题

热度:3   发布时间:2012-10-30 16:13:36.0
window.showModalDialogSelect标签返回值问题
父页面:
     $("#showmodaldialog").click(function() {
var result = window.showModalDialog("<%=request.getContextPath()%>/gcbase/components/certification/showmodal.jsp?type=1","aa","dialogWidth=400px;dialogHeight=100px");
var splitRs = result.split("|");
var oilType = document.getElementById("oilType");
for(var i01=0;i01<oilType.length;i01++) {
if(oilType.options[i01].innerText == splitRs[1]) {
oilType.options[i01].selected = true;
}
}
});

子页面:
       $("#ok").click(function() {
var selectVal = "";
var innerText = "";
var selectUnit = document.getElementById("orgunit");
for(var i01=0;i01<selectUnit.length;i01++) {
if(selectUnit[i01].selected == true) {
   innerText = document.getElementById("orgunit").options[i01].innerText;
   selectVal = selectUnit[i01].value;
}
}
parent.returnValue = selectVal + "|" + innerText;//返回值
window.close(); //关闭本窗体
      });
  相关解决方案