-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcontact_us.html
162 lines (140 loc) · 3.68 KB
/
contact_us.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<html>
<head>
<title>Contact us form </title>
<link rel="stylesheet" href="style3.css" href="scripts.js">
<script src="scripts.js"></script>
<style>
@import url('https://fonts.googleapis.com/css?family=Josefin+Sans');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
font-family: 'Josefin Sans', sans-serif;
}
body{
/*background-color: darkseagreen; */
background-image: url(https://image.freepik.com/free-vector/contact-us-woman-with-headphones-microphone-with-computer_113065-280.jpg);
}
.wrapper{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
max-width: 350px;
width: 100%;
background: #fff;
padding: 25px;
border-radius: 5px;
box-shadow: 4px 4px 2px rgba(254,236,164,1);
}
.wrapper h2{
text-align: center;
margin-bottom: 20px;
text-transform: uppercase;
letter-spacing: 3px;
color: #332902;
}
.wrapper .input_field{
margin-bottom: 10px;
}
.wrapper .input_field input[type="text"],
.wrapper textarea{
border: 1px solid #e0e0e0;
width: 100%;
padding: 10px;
}
.wrapper textarea{
resize: none;
height: 80px;
}
.wrapper .btn input[type="submit"]{
border: 0px;
margin-top: 15px;
padding: 10px;
text-align: center;
width: 100%;
background: #fece0c;
color: #332902;
text-transform: uppercase;
letter-spacing: 5px;
font-weight: bold;
border-radius: 25px;
cursor: pointer;
}
#error_message{
margin-bottom: 20px;
background: #fe8b8e;
padding: 0px;
text-align: center;
font-size: 14px;
transition: all 0.5s ease;
}
</style>
<script>
function validate(){
var name = document.getElementById("name").value;
var subject = document.getElementById("subject").value;
var phone = document.getElementById("phone").value;
var email = document.getElementById("email").value;
var message = document.getElementById("message").value;
var error_message = document.getElementById("error_message");
error_message.style.padding = "10px";
var text;
if(name.length < 4){
text = "Please Enter valid Name";
error_message.innerHTML = text;
return false;
}
if(subject.length < 10){
text = "Please Enter Correct Subject";
error_message.innerHTML = text;
return false;
}
if(isNaN(phone) || phone.length != 10){
text = "Please Enter valid Phone Number";
error_message.innerHTML = text;
return false;
}
if(email.indexOf("@") == -1 || email.length < 6){
text = "Please Enter valid Email";
error_message.innerHTML = text;
return false;
}
if(message.length <= 20){
text = "Please Enter More Than 140 Characters";
error_message.innerHTML = text;
return false;
}
alert("Your Query will be Solved or Answered Soon!");
return true;
}
</script>
</head>
<body>
<div class="wrapper">
<h2>Contact us</h2>
<div id="error_message"></div>
<form id="myform" onsubmit="return validate();">
<div class="input_field">
<input type="text" placeholder="Name" id="name">
</div>
<div class="input_field">
<input type="text" placeholder="Subject" id="subject">
</div>
<div class="input_field">
<input type="text" placeholder="Phone" id="phone">
</div>
<div class="input_field">
<input type="text" placeholder="Email" id="email">
</div>
<div class="input_field">
<textarea placeholder="Message" id="message"></textarea>
</div>
<div class="btn">
<a href="#"><input type="submit" value="SUBMIT NOW"></a>
</div>
</form>
</div>
</body>
</html>