Under the Hood: The Popup From a Form ScriptIn this page we'll look at the technical details of how to open a popup for the results of a form. If you just want to quickly implement a popup for a form you probably will do better starting with Popup Windows: From a Form.
The ScriptFirst let's look at the script used to open a popup from a form.
This script is a little different than the script we've used in most of our other examples. The main difference is that with a link we open the popup with the link's URL, then cancel the
Line 1 begins the script element and line 2 begins the comment that should surround every script.
Line 3 begins the
Line 4 has the opening bracket for the
Line 6 opens the popup. Notice that we don't give the popup
a URL. When the popup opens it's blank.
Line 7 sets the
8 returns true. Technically this line isn't needed because in the
Line 9 closes the function, 10 closes the comment, and 11 closes the script.