HTML and CSS Reference
In-Depth Information
Figure 11.23 When the user clicks one of the links, either the submit() or the reset()
method will be invoked.
Displaying a Form's Content in a Popup Window. After filling out a form, you
might want to display the form content for confirmation before submitting it to a server.
This can be done by creating another window, called a popup, and outputting the form
data dynamically into that window. Example 11.16 uses JavaScript to open a new win-
dow to display the gathered form data from another file.
EXAMPLE 11.16
<html>
<head><title>Display Form Input</title>
<script type="text/javascript">
1
function showForm(myform) {
2
NewWin=window.open('','','width=300,height=200');
3
name_input="<b>Your name: " + myform.user_name.value
+ "</b><br />";
4
NewWin.document.write(name_input);
phone_input="<b>Your phone: " + myform.user_phone.value
+ "</b><br />";
5
NewWin.document.write(phone_input);
}
6
function close_window(){
NewWin.window.close();
}
</script>
</head>
 
Search WWH ::




Custom Search