• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Creating Dialog Boxes

The Internet Explorer enables you to create dialog boxes with the showModalDialog and showModelessDialog methods that we’ll see in the next chapter. (A modal dialog box won’t let the user switch back to the main window while the dialog box is open—you have to deal with it before going back to what you were doing—but a modeless one will.) A dialog box is just an HTML document opened in a window that has a dialog box–like frame and which enables you to pass information back and forth between the opening window. When you create a new dialog box, you can use the dialogHeight, dialogLeft, dialogTop, and dialogWidth properties to set the dimensions of the box.

The most important properties here are the dialogArguments (which enables you to pass data to dialog boxes) and returnValue (which enables you to return data from dialog boxes) properties. Suppose, for example, that you want to let the user set some values using a dialog box. You can use the dialogArguments property to pass initial values to the dialog box’s code that can be displayed when the dialog box opens, and the returnValue property enables you to pass data back to the opening window when the user clicks the OK button. Note that both the dialogArguments and returnValue properties can take arrays of values.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint