-
Notifications
You must be signed in to change notification settings - Fork 0
/
peerCounselingFriend.html
147 lines (127 loc) · 5.68 KB
/
peerCounselingFriend.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
<!DOCTYPE html>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-166240419-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-166240419-1');
</script>
<title>Peer Counseling | FindHope</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="apple-touch-icon" sizes="180x180" href="./Logo/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="./Logo/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="./Logo/favicon-16x16.png" />
<link rel="manifest" href="./Logo/site.webmanifest" />
</head>
<body>
<!-- Start Contact Section -->
<div class="w3-container w3-light-grey w3-padding-32 w3-padding-large" id="contact">
<div class="w3-content" style="max-width: 600px;">
<h4 class="w3-center"><b>Peer Counseling for a friend</b></h4>
<script type="text/javascript">
var submitted = false;
window.onload = function () {
document.getElementById('myForm').reset();
}
</script>
<iframe name="hidden_iframe" id="hidden_iframe" style="display: none;"
onload="if(submitted) {window.location=`./redirect.html`;}"></iframe>
<!-- Update the Google forms URL in action-->
<form id="myForm"
action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSdnmQvNGJsKlpdedVdQhReSJQ826v9QhtiG8gviUKwVM2ep5A/formResponse"
method="post" target="hidden_iframe" onsubmit="return validateForm(); ">
<div class="w3-section">
<label>Name</label>
<input class="w3-input w3-border" type="text" placeholder="Name" id="name" required
name="entry.1178250215" />
</div>
<div class="w3-section">
<label>Email</label>
<input class="w3-input w3-border" type="text" placeholder="Email" id="email" required
name="entry.1270398549" />
</div>
<div class="w3-section">
<label>Whatsapp Number</label>
<input class="w3-input w3-border" f type="text" placeholder="Phone" id="phone" required
name="entry.554252665" />
</div>
<div class="w3-section">
<label>Preferred Language</label>
<p>
<input class="w3-radio" type="radio" name="entry.1097614754" value="English" checked>
<label>English</label></p>
<p>
<input class="w3-radio" type="radio" name="entry.1097614754" value="Hindi">
<label>Hindi</label></p>
<p>
<input class="w3-radio" type="radio" name="entry.1097614754" value="Telugu">
<label>Telugu</label></p>
</div>
<div class="w3-section">
<label>What made you realize that your friend needs help?</label>
<input class="w3-input w3-border" type="text" placeholder="" id="message" name="entry.237592060" />
</div>
<div class="w3-section">
<button class="w3-button w3-block w3-black w3-margin-bottom" type="submit">
SEND
</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
function validateName() {
var name = document.getElementById("name").value;
if (name.length == 0) {
alert("Name can't be blank");
return false;
}
return true;
}
function validatePhone() {
var phone = document.getElementById("phone").value;
if (phone.length == 0) {
alert("Phone number can't be blank"); //Validation Message
return false;
}
if (!phone.match(/^[0]?[6789]\d{9}$/)) {
alert("Please enter a correct phone number"); //Validation Message
return false;
}
return true;
}
function validateEmail() {
var mail = document.getElementById("email").value;
var email=mail.toLowerCase();
if (email.length == 0) {
alert("Email can't be blank"); //Validation Message
return false;
}
if (!email.match(/^[A-Za-z\._\-[0-9]*[@][A-Za-z]*[\.][a-z]{2,4}$/)) {
alert("Please enter a correct email address"); //Validation Message
return false;
}
return true;
}
function validateForm() {
if (!validateName() || !validatePhone() || !validateEmail()) {
alert("Form not submitted"); //Validation Message
return false;
} else {
submitted = true;
return true;
}
}
</script>
<!-- End Contact Section -->
</body>
</html>