-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
138 lines (123 loc) · 3.15 KB
/
form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
margin: auto;
padding:20px;
}
h1 {
margin-bottom: 20px;
color: #333;
}
label {
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
border-color: #007BFF;
outline: none;
}
button {
background-color: #007BFF;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #0056b3;
}
.output {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f9f9f9;
width: 100%;
}
.output h2 {
margin-top: 0;
}
.output p {
margin: 5px 0;
}
</style>
</head>
<body>
k <div class="container">
<h1>Login form</h1>
<br>
<br>
<form id="myForm">
<label for="Name"> Name</label>
<input type="text" id="name">
<br>
<br>
<label for="Email">Email</label>
<input type="email" id="Email">
<br>
<br>
<label for="PhoneNo.">PnoneNo.</label>
<input type="tel" id="PhoneNo">
<br>
<br>
<label for="Message">Message</label>
<textarea name="message" id="message"></textarea>
<br>
<br>
<button type="button" onclick="showdetails()"> Submit</button>
</form>
<div class="output" id="output" style="display: none;">
<h2>details</h2>
<p><strong>name</strong> <span id="displayname"></span></p>
<p><strong>Email</strong> <span id="displayEmail"></span></p>
<p><strong>PnoneNo</strong> <span id="displayPhoneNo"></span></p>
<p><strong>Message</strong> <span id="displayMessage"></span></p>
</div>
</div>
<script>
function showdetails()
{
document.getElementById('displayname').innerHTML=document.getElementById('name').value;
document.getElementById('displayEmail').innerHTML=document.getElementById('Email').value;
document.getElementById('displayPhoneNo').innerHTML=document.getElementById('PhoneNo').value;
document.getElementById('displayMessage').innerHTML=document.getElementById('message').value;
document.getElementById('output').style.display='block'
}
</script>
</body>
</html>