-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfitness.js
96 lines (96 loc) · 3.08 KB
/
fitness.js
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
$(document).ready(function(){
$(".menu-1").hover(function(){
$(this).css("color","rgb(224, 129, 19)")})
$(".menu-1").mouseleave(function(){
$(this).css("color","white")})
$(".menu-2").hover(function(){
$(this).css("color","rgb(224, 129, 19)")})
$(".menu-2").mouseleave(function(){
$(this).css("color","white")})
$(".menu-3").hover(function(){
$(this).css("color","rgb(224, 129, 19)")})
$(".menu-3").mouseleave(function(){
$(this).css("color","white")})
$(".menu-4").hover(function(){
$(this).css("color","rgb(224, 129, 19)")})
$(".menu-4").mouseleave(function(){
$(this).css("color","white")})
$(".main-matter-button").hover(function(){
$(this).css({"color":"white","border-color":"rgb(224, 129, 19)"})
})
$(".main-matter-button").mouseleave(function(){
$(this).css({"color":"rgb(224, 129, 19)","border-color":"white"})
})
$(".pre-main-matter-button").hover(function(){
$(this).css({"color":"white","border-color":"rgb(224, 129, 19)"})
})
$(".pre-main-matter-button").mouseleave(function(){
$(this).css({"color":"rgb(224, 129, 19)","border-color":"white"})
})
$(".menu-bar").click(function(){
$(".toggle").css("height","30%");
$(".menu-bar").hide();
$(".close").css("display","block");
$(".close").show();
})
$(".close").click(function(){
$(".toggle").css("height","0%");
$(".close").hide();
$(".menu-bar").show();
})
$("input").click(function(){
$(this).css("border-bottom","2px solid rgb(224, 129, 19)")
})
$(".hide,.hide-1,.hide-2,.hide-3").css("color","red")
$(".send").click(function(){
$("input").css("border-bottom","2px solid black");
var name= $(".name").val();
var check= /^[a-zA-Z\s]+$/;
if(name==""){
$(".hide").text("Enter your name");
return false;
}
else{true;}
if(!name.match(check)){
$(".hide").text("Enter your valid name");
return false;
}
else{true;}
if(name.length>20){
$(".hide").text("More than 20 char. is not allowed");
return false;
}
else{ $(".hide").text("");}
var check_email=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var email=$(".email").val();
if(email==""){
$(".hide-1").text("Enter your email id");
return false;
}
else{true}
if(!email.match(check_email)){
$(".hide-1").text("Enter your valid email id");
return false;
}
else{$(".hide-1").text("")}
var address= $(".address").val();
var check_address= /^([a-zA-Z\s])+$/;
if(address==""){
$(".hide-2").text("please enter your address");
return false;
}
else{$(".hide-2").text("")}
if(!address.match(check_address)){
$(".hide-2").text("enter your valid address");
return false;
}
else{$("hide-2").text("")}
var message =$(".messages").val();
if(message==""){
$(".hide-3").text("write something for us");
return false;
}
else{$(".hide-3").text("")}
alert("send");
})
})