forked from VAIBHAVBABELE/vaibhavbabele.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
731 lines (616 loc) · 32.7 KB
/
Copy pathindex.html
File metadata and controls
731 lines (616 loc) · 32.7 KB
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nitra mitra </title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="pages/team.css">
<link rel="stylesheet" href="pages/summary/summary.css">
<link rel="stylesheet" href="pages/assistant/assistant.css">
<link rel="stylesheet" href="pages/cursor.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Alex+Brush&family=Lora:ital,wght@0,400..700;1,400..700&family=Pacifico&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
<link rel="manifest" href="favicon/site.webmanifest">
<link rel="mask-icon" href="favicon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
</head>
<body id="onload">
<!-- NAVBAR DESIGNING -->
<nav>
<div class="logo "><a href="https://www.nitra.ac.in/ ">NITra <span id="mitra">MITra</span></a></div>
<input type="checkbox" id="click">
<label for="click" class="menu-btn">
<i class="fa-sharp fa-solid fa-bars"></i>
</label>
<ul>
<li><a href="index.html" id="active">Home</a></li>
<li><a href="#Services">Services</a></li>
<li><a href="#about">About </a></li>
<li><a href="#Feedback">Feedback</a></li>
<li><a href="pages/contact.html">Contact us</a></li>
<button id="lang-toggle">
हिंदी
</button>
</ul>
<img src="images/moon.png" id="mode" alt="Change mode" title="change mode">
<script src="index.js"></script>
</nav>
<div class="main">
<section id="Home">
<div class="container flex main-page">
<div class="header-left">
<h1 class="greeting">Welcome to Nitra Mitra</h1>
<p class="hero-subtext">Your ultimate platform for academic resources, campus updates, and community
connection at NITRA Technical Campus.</p>
<a href="#Services" class="primary-button get-started-btn">My Services</a>
</div>
<div class="header-right">
<img src="images/student.png" alt="student image">
</div>
</div>
</section>
<!-- SERVICE DESIGNING -->
<!-- SERVICE DESIGNING -->
<section class="service" id="Services">
<h1 class="service-heading">Services</h1>
<p class="para">Welcome to <span>Nitra Mitra</span>, your <b>ultimate platform</b> for <span>NITRA
Technical
Campus</span>, Ghaziabad. We offer a <b>comprehensive suite of resources</b>, from academic
materials to
event updates, designed to <b>enhance your learning experience</b>. Explore our <b>latest
features,
download
exclusive content</b>, and <b>stay connected with campus activities</b>. Don't miss out on
valuable
resources—download or view them directly on <span>Nitra Mitra</span> today! We value your
feedback;
please fill
out our <a href="#Feedback">feedback form</a> to help us improve and serve you better. Visit
<span>Nitra
Mitra</span> now!
</p>
<p class="para call-to-action-line">Browse our comprehensive offerings below:</p>
<div class="container1">
<div class="card">
<img src="images/resorce.jpg" class="card-img-top"
alt="Illustration representing academic resources">
<div class="card-body">
<h4 class="card-title">Resources</h4>
<p class="card-text"><b>Get all resources for BTECH Students.</b></p>
<a href="pages/resorces.html" class="primary-button" id="btn">Open </a>
</div>
</div>
<div class="card">
<img src="images/meeting.webp" class="card-img-top" alt="Game section">
<div class="card-body">
<h4 class="card-title">Games</h4>
<p class="card-text"><b>Multiple games plays.</b></p>
<a href="games/gamess.html" class="primary-button" id="btn">Play Now</a>
</div>
</div>
<div class="card">
<img src="images/gall.jpg" class="card-img-top" alt="gallery">
<div class="card-body">
<h4 class="card-title">Gallery</h4>
<p class="card-text"><b>View all events memories here.</b></p>
<a href="pages/gallery.html" class="primary-button" id="btn">Open</a>
</div>
</div>
<div class="card" style="width: 25%;">
<img src="images/5121453.jpg" class="card-img-top" alt="infrastructure">
<div class="card-body">
<h4 class="card-title">Infrastructure</h4>
<p class="card-text"><b>View all events memories here.</b></p>
<a href="pages/infrastructure.html" class="primary-button" id="btn">Open</a>
</div>
</div>
<div class="card" style="width: 25%;">
<img src="images/undraw_calculator_21hp.png" class="card-img-top" alt="CGPA Calculator">
<div class="card-body">
<h4 class="card-title">CGPA/SGPA Calculator</h4>
<p class="card-text"><b>Calculate your semester SGPA & overall CGPA.</b></p>
<a href="pages/cgpa-calculator.html" class="primary-button" id="btn">Calculate Now</a>
</div>
</div>
<div class="card" style="width: 25%;">
<img src="images/undraw_developer.png" class="card-img-top" alt="Placement Updates">
<div class="card-body">
<h4 class="card-title">Placement Cell Updates</h4>
<p class="card-text"><b>Stay updated with company drives, interviews, and shortlists.</b></p>
<a href="pages/placement-updates.html" class="primary-button" id="btn">View Updates</a>
</div>
</div>
<div class="card">
<img src="images/qna.webp" class="card-img-top" alt="student assistant">
<div class="card-body">
<h4 class="card-title">Student Assistant</h4>
<p class="card-text"><b>AI-powered chatbot for academic help.</b></p>
<a href="pages/assistant/assistant.html" class="primary-button" id="btn">Chat Now</a>
</div>
</div>
<div class="card" id="card">
<img src="images/qna.webp" class="card-img-top" alt="ai summary tool">
<div class="card-body">
<h4 class="card-title">AI Summary Tool</h4>
<p class="card-text"><b>Smart text & file summarization with notes enhancement.</b></p>
<a href="pages/summary/summary.html" class="primary-button" id="btn">Summarize Now</a>
</div>
</div>
<div class="card" id="card">
<img src="images/syllabus.avif" class="card-img-top" alt="Syllabus">
<div class="card-body">
<h4 class="card-title">Syllabus</h4>
<p class="card-text"><b>Access the latest syllabus for your courses.</b></p>
<a href="pages/syllabus/syllabus.html" class="primary-button" id="btn">View Syllabus</a>
</div>
</div>
</div>
</section>
<section>
<h1 class="service-heading" id="announcement-heading">Announcement Section</h1>
<style>
@media (max-width: 600px) {
#announcement-heading {
font-size: 1.9em;
font-weight: bold;
}
}
</style>
<p class="para">Your essential hub for all campus updates from <span>Nitra Technical Campus</span>!
The
<span>Announcement Section on Nitra Mitra</span> features key information to keep you fully
informed,
such as:
</p>
<ul class="announcement-list">
<li><b>Upcoming Events & Academic Deadlines:</b> Stay on top of all academic deadlines and
exciting
campus events.
</li>
<li><b>Examination Schedules & Important Notices:</b> Get timely updates on exams, circulars,
and
crucial
announcements.</li>
<li><b>Campus Activities & Cultural Events:</b> Discover and participate in various clubs,
societies,
and cultural
celebrations.</li>
<li><b>Sports Competitions & Student Achievements:</b> Follow inter-college sports action and
celebrate
the
accomplishments of your peers.</li>
</ul>
<p class="para">Check frequently to stay connected and never miss a key update!</p>
<div class="embed">
<!-- Source file: announcement-table.html has been added to the iframe -->
<iframe src="./pages/announcement-table.html" height="90%" width="100%" scrolling="auto"
style="overflow: auto;"></iframe>
</div>
</section>
<section>
<h1 class="service-heading">User Experience</h1>
<p class="para">The user experience on our platform has been overwhelmingly positive, with praise
for:</p>
<ul>
<li><b>Ease of Use & Comprehensive Resources:</b> Seamless access to <span>materials, including
notes,
announcements, and event updates</span>.</li>
<li><b>Intuitive Layout:</b> Easily find important information, from academic resources to
campus
activities.</li>
<li><b>One-Stop Platform:</b> Users have highlighted how <span>Nitra Mitra</span> serves as a
one-stop
platform that
enhances their college experience by keeping them informed and connected.</li>
<li><b>Mobile-Friendly Design:</b> Access resources anytime, anywhere.</li>
</ul>
<p class="para">Overall, <span>Nitra Mitra</span> has become an essential tool for students at
<span></span>Nitra
Technical Campus, offering a streamlined and user-friendly experience.
</p>
<div class="embed">
<iframe src="./pages/user-experience-table.html" height="90%" width="100%" scrolling="auto"
style="overflow: auto;"></iframe>
</div>
</section>
<!-- ABOUT DESIGNING --> <!--Shifted the About section-->
<section class="about " id="about">
<h1 class="service-heading">About us</h1>
<h2>Our Mission</h2>
<p class="para">
At <span>Nitra Mitra</span>, our core mission is to empower students of <span>NITRA Technical
Campus</span> and
<span>AKTU</span> by transforming their academic journey. We strive to be the ultimate,
user-friendly
platform
that simplifies access to a comprehensive suite of essential resources, from meticulously
compiled notes
and
previous semester question papers to timely event updates and career guidance. Our goal is to
equip
every
student with the tools they need to excel, making their college experience smoother and more
successful.
</p>
<h2>Who We Are</h2>
<p class="para">
<span>Nitra Mitra</span> is more than just a platform; it's a student-driven initiative born
from a deep
understanding of academic challenges. We are a collaborative community focused on simplifying
college
life
through innovative solutions and relevant content, built with a strong emphasis on user-friendly
design
and
accessibility.
It is proudly developed by <span>Vaibhav Babele</span> and <span>Ghanshyam Prajapati</span>,
dedicated
students
of <span>NITRA Technical Campus</span>. Their vision and hard work have been instrumental in
tailoring
<span>Nitra Mitra</span> to meet the specific needs of students, ensuring it provides tangible
academic
value.
</p>
<h2>Our Commitment</h2>
<p class="para">
At <span>Nitra Mitra</span>, our dedication extends beyond just providing resources; we are
deeply
committed to
the continuous enhancement of this platform. We pledge to tirelessly work towards serving the
academic
community
of <span>NITRA Technical Campus</span>, striving to evolve and adapt to student needs. Our
commitment is
to
consistently deliver updated, relevant content and innovative features that empower students
with the
essential
tools required to excel in their studies and thrive in their educational journey. Your success
is our
driving
force.
</p>
<h2 class="aktu-definition-heading">About AKTU</h2>
<p class="para aktu-definition-paragraph"> Dr. A.P.J. Abdul Kalam Technical University (AKTU) stands
as a
prominent
public collegiate university located in Uttar Pradesh, India. It serves as a major affiliating
body for
numerous
engineering, technology, and management colleges across the state. <span>Nitra Mitra</span> is
specifically
designed to cater to the academic and informational needs of students who are affiliated with
AKTU,
providing
tailored resources and updates to support their educational journey.
</p>
</section>
<!-- google form start-->
<section>
<h1 class="service-heading">Feedback Form</h1>
<p class="para">Your feedback is invaluable for shaping <span>Nitra Mitra</span> into the best
platform for
the
<span>NITRA Technical Campus</span> community.
We invite you to use the form below to share your details and experiences regarding the
website's
navigation,
content, design, and functionality.
Your specific input directly guides our enhancements, helping us create a more user-friendly and
engaging
resource tailored to your academic journey.
</p>
<div class="form">
<div class="form-flex">
<div class="form-card">
<h2 id="Feedback" class="form-heading">Feedback</h2>
<form name="submit-to-google-sheet">
<input type="text" placeholder="Name" name="Name" required><br><br>
<input type="email" placeholder="Email Address" name="Email" required><br><br>
<input type="text" placeholder="College Name " name="College" required><br><br>
<input type="text" placeholder="Branch" name="Branch" required><br><br>
<input type="number" placeholder="Passing Year" name="Passing Year" min="2020" max="2030"
required><br><br>
<select name="Year" required>
<optgroup label="1st Year">
<option value="" disabled selected hidden>Select Semester</option>
<option value="1 Year,1 Sem">1 Sem</option>
<option value="1 Year,2 Sem">2 Sem</option>
</optgroup>
<optgroup label="2nd Year">
<option value="2 Year,3 Sem">3 Sem</option>
<option value="2 Year,4 Sem">4 Sem</option>
</optgroup>
<optgroup label="3rd Year">
<option value="3 Year,5 Sem">5 Sem</option>
<option value="3 Year,6 Sem">6 Sem</option>
</optgroup>
<optgroup label="4th Year">
<option value="4 Year,7 Sem">7 Sem</option>
<option value="4 Year,8 Sem">8 Sem</option>
</optgroup>
</select><br><br>
<select name="Approve" required>Your Approval
<option value="yes">Allow</option>
<option value="no">Not Allow</option>
</select><br><br>
<textarea name="Message" placeholder="Message"></textarea><br><br>
<div class="emoji">
<h6>Rate The Website</h6>
<input type="radio" value="5 star" name="Feedback" id="five">
<label for="five">
<img src="images/grinning.png" alt="5 star">
</label>
<input type="radio" value="4 star" name="Feedback" id="four">
<label for="four">
<img src="images/smiling.png" alt="4 star">
</label>
<input type="radio" value="3 star" name="Feedback" id="three">
<label for="three">
<img src="images/diagonal-mouth.png" alt="3 star">
</label>
<input type="radio" value="2 star" name="Feedback" id="two">
<label for="two">
<img src="images/steam.png" alt="2 star">
</label>
<input type="radio" value="1 star" name="Feedback" id="one">
<label for="one">
<img src="images/pouting.png" alt="1 star">
</label>
</div>
<div><br>
<input class="primary-button get-started-btn" id="btn" type="submit" value="submit"
name="submit"><br><br>
</div>
<span id="success"></span>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbx_5lwHO3A6ap4ZoM0coWzboAUm1nqTHzSIaPT_Q6pB62TWYjIrCQVVUXpNqyzRhDGc/exec';
const form = document.forms['submit-to-google-sheet'];
const success = document.getElementById('success');
form.addEventListener('submit', e => {
e.preventDefault();
const submitBtn = form.querySelector('[type="submit"]');
submitBtn.disabled = true;
const originalText = submitBtn.value || submitBtn.textContent;
if (submitBtn.tagName === "INPUT") {
submitBtn.value = "Submitting...";
} else {
submitBtn.textContent = "Submitting...";
}
fetch(scriptURL, { method: 'POST', body: new FormData(form) })
.then(response => {
form.reset();
success.innerHTML = "✅ Successfully Submitted!";
setTimeout(() => {
success.innerHTML = "";
submitBtn.disabled = false;
if (submitBtn.tagName === "INPUT") {
submitBtn.value = originalText;
} else {
submitBtn.textContent = originalText;
}
}, 2000);
})
.catch(error => {
console.error('Error!', error.message);
success.innerHTML = "❌ Submission Failed. Please try again.";
setTimeout(() => {
success.innerHTML = "";
submitBtn.disabled = false;
if (submitBtn.tagName === "INPUT") {
submitBtn.value = originalText;
} else {
submitBtn.textContent = originalText;
}
}, 2000);
});
});
</script>
</form>
</div>
</div>
<h4 color="white">Total Visitors</h4>
<script type="text/javascript"></script>
<script type="text/javascript"
src="https://www.freevisitorcounters.com/en/home/counter/1204905/t/13"></script>
</div>
</section>
<!-- google form end-->
<!-- TEAM SECTION (Before Footer) -->
<section class="team-showcase">
<div class="container">
<div class="section-header">
<h2>Meet Our Team
</h2>
<p>
Dedicated developers working together to create the best educational platform for NITRA
students.
</p>
</div>
<div class="team-grid">
<!-- Vaibhav Babele Card -->
<div class="team-showcase-card">
<div class="team-avatar">
<img src="images/vaibhav.jpg" alt="Vaibhav Babele">
</div>
<h3>Vaibhav
Babele</h3>
<p>
Lead Developer & Founder</p>
<p>
Computer Science Engineering student passionate about creating educational platforms for
students.
</p>
<div class="social-links">
<a href="https://www.linkedin.com/in/vaibhavbabele" target="_blank">
<i class="fab fa-linkedin"></i>
</a>
<a href="https://github.com/vaibhavbabele" target="_blank">
<i class="fab fa-github"></i>
</a>
</div>
</div>
<!-- Ghanshyam Prajapati Card -->
<div class="team-showcase-card">
<div class="team-avatar">
<img src="images/ghanshyam.jpeg" alt="Ghanshyam Prajapati">
</div>
<h3>Ghanshyam
Prajapati</h3>
<p>
Co-Developer</p>
<p>
Dedicated developer contributing to the platform's growth and student experience
enhancement.
</p>
<div class="social-links">
<a href="https://www.linkedin.com/in/ghanshyam-prajapati-ab5710266/?originalSubdomain=in"
target="_blank">
<i class="fab fa-linkedin"></i>
</a>
</div>
</div>
<!-- Development Team Card -->
<div class="team-showcase-card">
<div class="team-avatar placeholder">
<i class="fas fa-users"></i>
</div>
<h3>
Development Team</h3>
<p>
Contributors & Maintainers</p>
<p style="color: var(--secondary-text-color); line-height: 1.6; margin-bottom: 25px;">
A growing community of student developers working together to improve the platform.
</p>
<div class="social-links">
<a href="pr-contributors.html">
<i class="fas fa-users"></i>
</a>
</div>
</div>
</div>
</div>
</section>
<!-- CONTACT DESIGNING -->
<!-- CONTACT DESIGNING -->
<footer class="footer-section">
<div class="container">
<h1 class="contact-heading">Contact Us</h1>
<div class="contact-grid">
<div class="contact-item">
<a href="https://wa.me/919999999999" target="_blank" class="contact-link">
<i class="fab fa-whatsapp"></i>
<span>Whatsapp Community</span>
<p>Nitra Mitra</p>
</a>
</div>
<div class="contact-item">
<a href="mailto:nitramitra@gmail.com" class="contact-link">
<i class="fas fa-envelope"></i>
<span>Email</span>
<p>nitramitra@gmail.com</p>
</a>
</div>
<div class="contact-item">
<a href="https://www.google.com/maps?q=Sanjay+Nagar,+Ghaziabad" target="_blank"
class="contact-link">
<i class="fas fa-map-marker-alt"></i>
<span>Address</span>
<p>Sanjay Nagar, Ghaziabad, India</p>
</a>
</div>
</div>
<div class="social-media">
<a href="https://youtube.com/@my.vlog_spot" target="_blank"><i class="fab fa-youtube"></i></a>
<a href="https://www.linkedin.com/in/vaibhavbabele" target="_blank"><i
class="fab fa-linkedin"></i></a>
<a href="https://www.instagram.com/my_vlog.spot/" target="_blank"><i
class="fab fa-instagram"></i></a>
<a href="#" title="Twitter"><i class="fab fa-twitter"></i></a>
</div>
<div class="footer-links">
<a href="pages/privacy.html">Privacy Policy</a> |
<a href="pages/terms.html">Terms & Conditions</a> |
<a href="pages/contact.html">Contact</a> |
<a href="pages/pr-contribution/pr-contributors.html">Contributors</a>
</div>
<p class="copyright">
© <span id="year"></span> 2025 Nitra Mitra. All Rights Reserved.
</p>
</div>
</footer>
</div>
<!-- WEBSITE DESIGNING END -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/typed.js@2.1.0/dist/typed.umd.js"></script>
<script>
var Typed = new Typed(".greeting", {
strings: ["Hello!! Students"],
typeSpeed: 150,
backspeed: 150,
loop: false,
showCursor: false
})
</script>
<script src="index.js">
</script>
<script>
// 1. Validation Functions
function validateEmail(email) {
const pattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return pattern.test(email);
}
function validateTextField(value) {
// Allows letters, spaces, hyphens
const pattern = /^[A-Za-z\s-]+$/;
return pattern.test(value);
}
// 2. Attach to Form Submit
document.addEventListener('DOMContentLoaded', () => {
const form = document.forms['submit-to-google-sheet'];
const nameInput = form.elements['Name'];
const emailInput = form.elements['Email'];
const collegeInput = form.elements['College'];
const errorContainer = document.createElement('div');
errorContainer.style.color = 'red';
form.prepend(errorContainer);
form.addEventListener('submit', function (e) {
errorContainer.innerHTML = ''; // Clear previous errors
let errors = [];
if (!validateTextField(nameInput.value.trim())) {
errors.push('Name must contain only letters, spaces, or hyphens.');
}
if (!validateEmail(emailInput.value.trim())) {
errors.push('Please enter a valid email address.');
}
if (!validateTextField(collegeInput.value.trim())) {
errors.push('College name must contain only letters, spaces, or hyphens.');
}
if (errors.length) {
e.preventDefault();
// Display errors
errors.forEach(msg => {
const p = document.createElement('p');
p.textContent = msg;
errorContainer.appendChild(p);
});
}
});
});
</script>
<!-- Google Translate -->
<div id="google_translate_element" style="display:none;"></div>
<script src="language.js"></script>
</body>
</html>