Copy codeThe Code is as follows:
// Return the value to the parent form
Function returnParent (value) {// obtain the return value of the child form
Var parent = window. dialogArguments; // obtain the parent page
// Parent. location. reload (); // refresh the parent page
If (parent! = Null & parent! = "Undefined "){
Window. returnValue = value; // Return value
Window. close (); // close the subpage
}
// Define your opener.doc ument. getElementById ("ActivityPic"); // directly operate the parent form Element
// $ (Selector, callback parent.doc ument); used for frame class pages
// $ (Selector, please specify opener.doc ument); this is a suitable page to be opened separately.
Return;
}
// Open the mode subform and obtain the return value.
Function showModalOnly (me, url) {// pop-up form, single choice
Var hidden = document. getElementById (me); // obtain the hidden Control
If (hidden! = Null & hidden. value! = Null & hidden. value. length> 0 ){
Alert ("this is a single choice. Please Delete the existing options and try again. ");
Return;
}
Var reValue = window. showModalDialog (url, window, "dialogHeight: 500px; dialogWidth: 987px; status: off; scroll: auto ");
If (reValue = null | reValue = "undefined" | reValue = ""){
Return; // If the returned value is null, return
}
Var index = reValue. split ("^"); // location of the delimiter ^
If (index [0] = null | index [0] = "undefined" | index [0]. length <1 ){
Return;
}
Var hid = index [0]. split ('&'); // assign a value to the hidden Control
Var view = index [1]. split ('&'); // display value
Var content = ""; // content to be added to check
If (hid! = Null & hid. length = 2 ){
Var I = 0;
If (hid [I]! = "Undefined" & hid [I]! = "" & View [I + 1]! = "Undefined" & view [I + 1]! = ""){
Content + = '<table id = "' + hid [I]
+ '"Class =" deleteStyle "> <tr> <td> + "'" + Hid [I] + "'," + "'" + me + "'" + '); "/> </td> <td> '+ view [I + 1] +' </td> </tr> </table> ';
Hidden. value = hid [I]; // assign a value to the hidden Control
Var c = document. getElementById ("check" + me );
C. innerHTML + = content;
Return;
}
}
Alert ("select only one data entry. ");
Return;
}
Function openUploadWindow (url, width, height, left, top ){
If (width = null) width = 987;
If (height = null) height = 500;
If (left = null) left = 200;
If (top = null) top = 200;
// Window. open (url, 'newwindow', 'height = '+ height +', width = '+ width +', top = 200, left = 200, toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no ');
Window. showModalDialog (url, window, "dialogHeight:" + height + "px; dialogWidth:" + width + "px; status: off; scroll: auto; dialogLeft: "+ left +" px; dialogTop: "+ top +" px ");
}