=================
=================
function vv()
{
kv=window.showModalDialog("test2.aspx",window);
/* 1
var newoption=document.createElement("Option")
newoption.text=kv;
document.getElementById("ee").options.add(newoption);
*/
/*2*/
var option=new Option(kv,kv);
document.getElementById("ee").options.add(option);
}
function cc()
{
/*一种方案:子窗体直接给父窗体赋值,事件全部在子窗体中处理*/
window.dialogArguments.document.Form1.Text1.value=document.getElementById('s2').value;
/* 正确赋值*/
var newoption=window.dialogArguments.document.createElement("Option")
newoption.text=document.getElementById('s2').value;
window.dialogArguments.document.getElementById("ss").options.add(newoption);
/*第二种方案:子窗体将值传回父窗体,由父窗体处理*/
window.returnValue= document.getElementById('s2').value;
window.close();
}
版权 @CSharp-net QQ757015000