-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (106 loc) · 5.17 KB
/
index.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
<!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>Student Info Form</title>
<link rel="stylesheet" href="form-Style.css">
</head>
<body>
<div class="container">
<div class="Header">
<h1>Student's Data Form</h1>
<hr>
</div>
<form method="post" name="google-sheet">
<div class="Personal">
<h2>Personal Information</h2>
<label for="Name">Full Name </label>
<input required type="text" name="Name" id="Name" placeholder="Name">
<br>
<label for="Gender">Gender </label>
<fieldset>
<input required type="radio" name="Gender" value="Male" id="Male">Male
<input type="radio" name="Gender" value="Female" id="Female">Female
<input type="radio" name="Gender" value="Others" id="Others">Others
</fieldset>
<br>
<label for="Father_Name">Father's Name </label>
<input required type="text" name="Father_Name" id="Father_Name" placeholder="Father's Name">
<br>
<label for="Phone_Number">Phone No. </label>
<input required type="tel" name="Phone_Number" id="Phone_Number" placeholder="1234567890" pattern="[0-9]{10}">
<br>
<label for="WhatsApp_Number">WhatsApp No. </label>
<input required type="tel" name="WhatsApp_Number" id="WhatsApp_Number" placeholder="1234567890" pattern="[0-9]{10}">
<br>
<label for="Email">Email </label>
<input required type="email" name="Email" id="Email" placeholder="[email protected]">
<br>
<label for="LinkedIn">LinkedIn </label>
<input type="url" name="LinkedIn" id="LinkedIn" placeholder="https://linkedin.com/name">
<br>
<label for="Address">Address </label>
<textarea name="Address" id="Address" cols="30" rows="5" placeholder="Address here"></textarea>
<br>
</div>
<div class="Academic">
<h2>Academic Information</h2>
<label for="Roll_Number">Roll No.</label>
<input type="number" name="Roll_Number" id="Roll_Number" placeholder="Your University Roll Number here" required>
<br>
<label for="Course">Course </label>
<select name="Course" id="Course" required>
<option name="Course" value="none" selected disabled hidden>--Select a Course--</option>
<option name="Course" value="B.Tech">B.Tech</option>
<option name="Course" value="B.Pharm">B.Pharm</option>
<option name="Course" value="BBA">BBA</option>
</select>
<br>
<label for="Branch">Branch </label>
<select name="Branch" id="Branch" required>
<option name="Branch" value="N/A">N/A</option>
<option name="Branch" selected disabled hidden>--Select a Branch (Select N/A for Non-B.Tech)--</option>
<option name="Branch" value="CSE">CSE</option>
<option name="Branch" value="CSE AIML">CSE AIML</option>
<option name="Branch" value="CSE IoT">CSE IoT</option>
<option name="Branch" value="CSE DS">CSE DS</option>
<option name="Branch" value="ECE">ECE</option>
<option name="Branch" value="EEE">EEE</option>
<option name="Branch" value="ME">ME</option>
<option name="Branch" value="CE">CE</option>
</select>
<br>
<label for="Year">Year </label>
<select name="Year" id="Year" required>
<option name="Year" value="1">First</option>
<option name="Year" value="2">Second</option>
<option name="Year" value="3">Third</option>
<option name="Year" value="4">Fourth</option>
<option name="Year" selected disabled hidden>--Select your Year--</option>
</select>
<br>
<label for="Section">Section </label>
<input required type="text" name="Section" id="Section" size="1" placeholder="Write just one character for section in Capital Letters (Example: A, B, C, D, I)">
<br>
</div>
<div class="btns">
<input class="btnSub" type="submit" name="Submit-btn" id="Submit-btn">
<input class="btnRes" type="reset" name="Reset" id="Reset">
<br>
</div>
</form>
</div>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbxrK9Ae_uV5y9QUYnaqLN3_Lx8yHO0YVmX6DKHxPA7hfHFcGyVB6WcYGcRx5vqLexG6/exec'
const form = document.forms['google-sheet']
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => alert("Data Successfully Submitted!"))
.catch(error => console.error('Error!', error.message))
})
</script>
</body>
</html>