-
Notifications
You must be signed in to change notification settings - Fork 129
/
contact-form.html
104 lines (97 loc) · 3.88 KB
/
contact-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
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="CSS_files/contact-form.css">
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body style="background-image:url('Images/login-background.jpg');background-size: cover;">
<div class="container">
<div class="container form bg-white pt-5 mt-4 mb-3">
<p class="text-center contact-heading">contact us</p>
<div class="container">
<div class="row pl-5 pt-3">
<div class="col-12 pt-3">
<input type="text" placeholder="name" style="width:85%;border:transparent;border-bottom:2px solid black;height:40px" class="name">
<div class="name-hide"></div>
</div>
<div class="col-12 pt-4">
<input type="text" placeholder="mobile no." style="width:85%;border:transparent;border-bottom:2px solid black;height:40px" class="mobile">
<div class="mobile-hide"></div>
</div>
<div class="col-12 pt-4">
<input type="text" placeholder="email id" style="width:85%;border:transparent;border-bottom:2px solid black;height:40px" class="email">
<div class="email-hide"></div>
</div>
<div class="col-12 pt-5">
<textarea rows="5" placeholder="message" style="width:85%" class="message"></textarea>
<div class="hide-message"></div>
</div>
<div class="col-12 pt-5">
<a href="j"><span class="btn text-white send-button" style="width:85%">send</span></a>
</div>
</div>
</div>
</div>
</div>
<script>
$(".send-button").click(function(){
var firstname=$(".name").val();
var check= /^[a-zA-Z\s]+$/;
//name//
if(firstname==""){
$(".name-hide").text("Enter your name");
return false;}
else{true;}
if(!firstname.match(check)){
$(".name-hide").text("Enter your valid name");
return false;}
else{true;}
if(firstname.length>20){
$(".name-hide").text("More than 20 char. is not allowed");
return false;
}
else{ $(".first-name-hide").text("");}
//mobile no//
var mobile=$(".mobile").val();
var check_moblie=/^[0-9]+$/;
if(mobile==""){
$(".mobile-hide").text("enter your mobile no.");
return false;
}
else{true}
if(!mobile.match(check_moblie)){
$(".mobile-hide").text("enter your valid mobile no.");
return false;
}
else{$(".mobile-hide").text("");}
//mobile no//
//email //
var check_email=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var email=$(".email").val();
if(email==""){
$(".email-hide").text("Enter your email id");
return false;
}
else{true}
if(!email.match(check_email)){
$(".email-hide").text("Enter your valid email id");
return false;
}
else{ $(".email-hide").text("");}
//message//
var message =$(".message").val();
if(message==""){
$(".hide-message").text("write something for us");
return false;
}
else{$(".hide-message").text("")}
})
</script>
</body>
</htmml>