HTML and CSS Reference
EXAMPLE 11.16 ( CONTINUED )
<body><hr><h3> Display form data in a little window</h2><p>
Please enter your name: <br />
<input type="text" size="50" name="user_name" />
Please enter your phone: <br />
<input type="text" size="30" name="user_phone" />
value="show form data"
Click here to close little window</a>
ence to the name of the form; in this example, myform .
A new window object is created with the window's open() method.
The variable called name_input is assigned a string that will contain HTML tags
and the value that was assigned to the form's text field.
The document of the new window will display the string value assigned to the
variable name_input in line 3.
The document of the new window will display the string value assigned to
This function will close the new window.
The HTML form called formtest starts here.
The input type for this form consists of two text fields that will be used to obtain
the name and the phone of the user.
When the button input device is clicked, the onClick handler will be invoked. This
is when you will see the new little window appear on the screen with all the form
not try to go to some URL when clicked (like the # in Example 11.17). Instead,
event handler close_window() will be invoked and the little window that was
opened to display the form data will be closed. See Figure 11.24.