父页面:
$("#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(); //关闭本窗体
});
$("#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(); //关闭本窗体
});