how to take input from form and display in javascript

Solutions on MaxInterview for how to take input from form and display in javascript by the best coders in the world

showing results for - "how to take input from form and display in javascript"
Kaliyah
23 Jun 2019
1<html>
2<head>
3<title>Form Example</title>
4<script LANGUAGE="JavaScript" type="text/javascript">
5function display() {
6  DispWin = window.open('','NewWin', 'toolbar=no,status=no,width=300,height=200')
7  message = "<ul><li><b>NAME: </b>" + document.form1.yourname.value;
8  message += "<li><b>ADDRESS: </b>" + document.form1.address.value;
9  message += "<li><b>PHONE: </b>" + document.form1.phone.value + "</ul>";
10  DispWin.document.write(message);
11}
12</script>
13</head>
14<body>
15<h1>Form Example</h1>
16Enter the following information. When you press the Display button,
17the data you entered will be displayed in a pop-up window.
18<form name="form1">
19<p><b>Name:</b> <input TYPE="TEXT" SIZE="20" NAME="yourname">
20</p>
21<p><b>Address:</b> <input TYPE="TEXT" SIZE="30" NAME="address">
22</p>
23<p><b>Phone: </b> <input TYPE="TEXT" SIZE="15" NAME="phone">
24</p>
25<p><input TYPE="BUTTON" VALUE="Display" onClick="display();"></p>
26</form>
27</body>
28</html>