HTML and CSS Reference
In-Depth Information
EXAMPLE
13.17 (
CONTINUED
)
</head>
<body bgcolor="yellow">
4
<form name="form1" onSubmit="return popUp();">
<p>
<table>
<tr>
<td>
<b>Type your name:</b>
</td>
<td>
5
<input type="text"
name="namestring"
size="50">
</td>
</tr>
<tr>
<td>
<b>Type in your address:</b>
</td>
<td>
6
<input type="text"
name="address"
size="80">
</td>
</tr>
</table>
<p>
<input type="submit" value="Submit form" />
<input type="reset" value="Clear" />
</form>
</body>
</html>
EXPLANATION
1
A function called
popUp()
is defined. It will cause a popup window to appear with
data that was entered into a form. (Your browser might not allow popup windows
unless you change a setting.)
2
This is where the new
window
object is created and assigned properties. (In this
example, the line is broken to make it fit on the page, but if you do this in a script,
make sure there are no spaces between any of the window options.)
3
The
write()
method will send its output to the new window.