-
Notifications
You must be signed in to change notification settings - Fork 1
/
register.html
83 lines (76 loc) · 3.51 KB
/
register.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>registration form</title>
<link href="/css/styles.css" rel="stylesheet">
</head>
<body>
<div class="form">
<form action="/" method="post">
<h2>Registration form</h2>
<!-- <label for="">Full Name</label> -->
<input type="text" name="name" id="username" placeholder="Full Name" required title="your name here"><br>
<span id="errorname" style="color: red;"></span>
<input type="email" name="email" id="email" placeholder="Enter your email ID" required><br>
<span id="erroremail" style="color: red;"></span>
<input type="password" name="password" id="password" placeholder="Enter Password">
<input type="number" name="phone_number" id="number" placeholder="Enter Mobile number"><br>
<span id="errornumber" style="color: red;"></span>
<select name="year" id="year" required>
<option value="">YEAR</option>
<option value="">1st year</option>
<option value="">2nd year</option>
<option value="">3rd year</option>
<option value="">4th year</option>
</select><br>
<input type="text" name="college name" id="" placeholder="Enter Your college name"><br>
<button type="submit" name="submit"><a href="/home">Register</a></button>
<button type="reset"><a href="/signIn">SignIn</a></button>
</form>
</div>
<script type="text/javascript">
function validation(){
var username = document.getElementById('username').value;
var email = document.getElementById('email').value;
var number = document.getElementById('number').value;
var usercheck = /^[A-Za-z]{3,40}$/;
var emailcheck = /^[A-Za-z 0-9.]{3,}@[A-Za-z]{3,}[.]{1}[A-Za-z]{2,6}$/;
var numbercheck = /^[6789][0-9]{9}$/;
if (usercheck.test(username)){
document.getElementById('errorname').innerHTML = " ";
}
else{
document.getElementById('errorname').innerHTML = "---**Invalid Name**---"
return false;
}
if (emailcheck.test(email)){
document.getElementById('erroremail').innerHTML = " ";
}
else{
document.getElementById('erroremail').innerHTML = "---**Invalid Name**---"
return false;
}
if (numbercheck.test(number)){
document.getElementById('errornumber').innerHTML = " ";
}
else{
document.getElementById('errornumber').innerHTML = "---**Invalid Name**---"
return false;
}
}
</script>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbwuz5-sJlTCvaVglP-yPY2901KPHpIoWrTnzAnr-XERabzav1jSkNDRMFEs4ZwVaDT0/exec'
const form = document.forms['report-me']
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => alert("Thank you .. .somesh will call you soon"))
.catch(error => console.error('Error!', error.message))
})
</script>
</body>
</html>