-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
205 lines (184 loc) · 9.61 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Techvolution</title>
</head>
<body>
<div class="container-fluid bg-color text-light py-3">
<header class="text-center">
<h1 class="display-6">Techvolution 2024 Registration Form </h1>
</header>
</div>
<section class="container my-2 w-50 text-light p-2">
<form class="row g-3 p-3">
<div class="col-md-4">
<label for="validationDefault01" class="form-label">First name</label>
<input type="text" class="form-control" id="validationDefault01" placeholder="First name" required>
</div>
<div class="col-md-4">
<label for="validationDefault02" class="form-label">Last name</label>
<input type="text" class="form-control" id="validationDefault02" placeholder="Last name" required>
</div>
<div class="col-md-5">
<label for="validationDefault02" class="form-label">Date Of Birth</label>
<input type="date" class="form-control" id="validationDefault02">
</div>
<div>
<label for="gender">Gender:</label><br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
<input type="radio" id="non-binary" name="gender" value="non-binary">
<label for="non-binary">Non-Binary</label>
</div>
<div class="col-md-6">
<label for="inputEmail4" class="form-label">Email Address</label>
<input type="email" class="form-control" id="inputEmail4">
</div>
<div>
<label for="phone">phone number:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">
</div>
<div class="col-12">
<label for="inputAddress" class="form-label">Street Address</label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="form-group col-md-4">
<label for="inputState">City</label>
<select class="form-control" id="inputState">
<option value="SelectState">Select City</option>
<option value="Andra Pradesh">Mumbai</option>
<option value="Arunachal Pradesh">Delhi</option>
<option value="Assam">Jaipur</option>
<option value="Bihar">Patna</option>
<option value="Chhattisgarh">Bangalore</option>
<option value="Goa">Hyderabad</option>
<option value="Gujarat">Gwalior</option>
<option value="Haryana">Jodhpur</option>
</select>
</div>
</div>
<div class="form-group col-md-4">
<label for="inputState">State</label>
<select class="form-control" id="inputState">
<option value="SelectState">Select State</option>
<option value="Andra Pradesh">Andra Pradesh</option>
<option value="Arunachal Pradesh">Arunachal Pradesh</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Chhattisgarh">Chhattisgarh</option>
<option value="Goa">Goa</option>
<option value="Gujarat">Gujarat</option>
<option value="Haryana">Haryana</option>
<option value="Himachal Pradesh">Himachal Pradesh</option>
<option value="Jammu and Kashmir">Jammu and Kashmir</option>
<option value="Jharkhand">Jharkhand</option>
<option value="Karnataka">Karnataka</option>
<option value="Kerala">Kerala</option>
<option value="Madya Pradesh">Madya Pradesh</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Manipur">Manipur</option>
<option value="Meghalaya">Meghalaya</option>
<option value="Mizoram">Mizoram</option>
<option value="Nagaland">Nagaland</option>
<option value="Orissa">Orissa</option>
<option value="Punjab">Punjab</option>
<option value="Rajasthan">Rajasthan</option>
<option value="Sikkim">Sikkim</option>
<option value="Tamil Nadu">Tamil Nadu</option>
<option value="Telangana">Telangana</option>
<option value="Tripura">Tripura</option>
<option value="Uttaranchal">Uttaranchal</option>
<option value="Uttar Pradesh">Uttar Pradesh</option>
<option value="West Bengal">West Bengal</option>
</select>
</div>
</div>
<div class="form-group col-md-4">
<label for="inputZip" class="form-label">Zip Code</label>
<input type="text" class="form-control" id="inputZip">
</div>
<div class="form-group col-md-4">
<label for="inputState">Event Preferences</label>
<select class="form-control" id="inputState">
<option value="SelectState">Select Preferences</option>
<option value="Hackathons">Hackathons</option>
<option value="Coding Challenges">Coding Challenges</option>
<option value="Tech Talks">Tech Talks</option>
<option value="Startup Pitches">Startup Pitches</option>
</select>
</div>
<div>
<label for="Dietry Restrictions">Dietry Restrictions</label></p>
<textarea id="Dietry Restrictions" name="Dietry Restrictions" rows="4" cols="50" placeholder="Enter Text Here"> </textarea>
</div>
<div class="mb-3">
<label for="size" class="form-label">T-Shirt Size:</label>
<select class="form-select" id="size" name="size" required>
<option value="">Select Size</option>
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">Extra Large</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Submit </button>
</form>
</section>
<script>
function validateForm() {
let isValid = true;
const name = document.getElementById('name').value.trim();
const email = document.getElementById('email').value.trim();
const phone = document.getElementById('phone').value.trim();
const dateOfBirth = document.getElementById('dateOfBirth').value;
// Validate name
if (name === '') {
document.getElementById('nameError').textContent = 'Name is required';
isValid = false;
} else {
document.getElementById('nameError').textContent = '';
}
// Validate email
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!emailRegex.test(email)) {
document.getElementById('emailError').textContent = 'Invalid email format';
isValid = false;
} else {
document.getElementById('emailError').textContent = '';
}
// Validate date of birth (basic check for empty date)
if (dateOfBirth === '') {
document.getElementById('dateOfBirthError').textContent = 'Date of Birth is required';
isValid = false;
} else {
document.getElementById('dateOfBirthError').textContent = '';
}
return isValid;
}
</script>
<script type="text/javascript">
function validateForm() {
return checkPhone();
}
function checkPhone() {
var phone = document.forms["myForm"]["phone"].value;
var phoneNum = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
if(phone.value.match(phoneNum)) {
return true;
}
else {
document.getElementById("phone").className = document.getElementById("phone").className + " error";
return false;
}
}
</script>
<script src="script.js"></script>
</body>
</html>