1. 程式人生 > >模態視窗間傳遞多個值

模態視窗間傳遞多個值

2 建立一個叫ChildWebform 的窗體,寫入HTML程式碼如下
  <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <TITLE>Child Webform</TITLE>
        <script language=
"javascript">
function Done() {
   
var ParmA = tbParamA.value;
   
var ParmB = tbParamB.value;
   
var ParmC = tbParamC.value;
   
var MyArgs = new Array(ParmA, ParmB, ParmC);
    window.returnValue = MyArgs;
    window.close();
}
function doInit() {
   
var ParmA = "Aparm";
   
var ParmB = "Bparm";
   
var ParmC = "Cparm";
   
var MyArgs = new Array(ParmA, ParmB, ParmC);
    MyArgs =  window.dialogArguments;
    tbParamA.value = MyArgs[
0].toString();
    tbParamB.value = MyArgs[
1].toString();
    tbParamC.value = MyArgs[
2].toString();
}
        </script>
    </HEAD>
    <BODY onload=
"doInit()">
        <P>Param A:<INPUT id=
"tbParamA" TYPE="text"></P>
        <P>Param B:<INPUT ID=
"tbParamB" TYPE="text"
></P>
        <P>Param C:<INPUT ID=
"tbParamC" TYPE="text"></P>
        <BUTTON onclick=
"Done()" type="button">OK</BUTTON>
    </BODY>
</HTML>