Use of the pop-up window

xiaoxiao2021-03-06  84

In the work encountered such a problem, you need to pop up a window while passing the value to the pop-up window, and returns a value from the pop-up window.

The solution is as follows:

1, pop up a window checkdlg.htm and pass the value of TXTPTC and TXTPHC

Function showdlg ()

{

VAR Objdlg = new object ();

Objdlg.value1 = frmcheck.txtptc.value;

Objdlg.Value2 = frmcheck.txtphc.value;

frmcheck.txtdlg.value = window.showModalDialog ( "checkdlg.htm", objdlg, "dialogHeight: 150px; dialogWidth: 600px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: Yes status: no; scroll: NO; ");

}

2, receive data in Checkdlg.htm

Function setbbsm ()

{

Var obj1 = window.dialogarguments;

TXTQSpt.maxlength = obj1.value1;

TXTZZPT.MAXLENGTH = Obj1.Value1;

TXTQS.MAXLENGTH = Obj1.value2;

TXTZZ.MAXLENGTH = Obj1.value2;

WINDOW.RETURNVALUE = ""

}

3. Return the value by pop-up window

Function Submit1_onclick ()

{

WINDOW.RETURNVALUE = TxtQs.Value "," TXTZZ.VALUE "," TXTQSPT.VALUE;

WINDOW.OPENER = NULL;

WINDOW.CLOSE ();

}

That is, the frmCheck.txtdlg.value value is the value returned by the pop-up window.

转载请注明原文地址:https://www.9cbs.com/read-106908.html

New Post(0)