In this fourth part of a five-part series that details some of the things you can do with web page dialog boxes, you will learn how to change and add content to the immediate parent box, add a row to a parent dialog box, and much more.
More Tricks with Web Page Dialog Boxes - Already Prepared Dialog Boxes (Page 3 of 5 )
Note that a dialog box as it is in this series is a web page with restricted features. You can have a web page and several dialog boxes (web pages) saved in a server. These pages could be coded such that each would open the next. The main statement used to open a window is:
window.open(“”,””,””,””)
The first parameter takes the URL. So the URL of a page that is already prepared goes here. You put the presentation arguments in the specs (third) position. If you do not want the second and fourth parameters, allow them as empty strings. The following code is for a simple web page.
<button type="button" onclick="openNext()">Click to Open Next Dialog</button>
</html>
The above page is titled Page 0. This page has a button that calls a function. This function opens a dialog box. The dialog box is a web page that is already prepared. The dialog box (page) is in the same directory in the server as the main page above. The file name of the dialog box is page1.htm. Since the dialog box is in the same directory, all you need is the name (not the full path) for the URL argument in the open() function. The code for the dialog box opened by this page is as follows:
<button type="button" onclick="openNext()">Click to Open Next Dialog</button>
</html>
Note the arguments that I have given for the specs parameter in this code and in the previous sample. This page will open the dialog box whose code is given below. The dialog box will also open the one whose code is given after that sample. The main page and the dialog boxes are in the same directory in the server.