-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
743 lines (667 loc) · 24.8 KB
/
index.html
File metadata and controls
743 lines (667 loc) · 24.8 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
732
733
734
735
736
737
738
739
740
741
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Joining Form</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<form id="employeeForm">
<!-- Navbar -->
<div class="navbar">
<div class="navbar-left">
<span class="icon" title="Home"><i class="fa-solid fa-house"></i></span>
</div>
<div class="navbar-center">
<h2>Joining Form</h2>
</div>
<div class="navbar-right">
</div>
</div>
<!-- Form Section -->
<div class="form-section">
<h3>Personal Details</h3><br>
<!-- Row 1: Name Fields -->
<div class="form-row">
<div class="form-group">
<label for="firstName">First Name <span class="required">*</span></label>
<input type="text" id="firstName" name="firstName" placeholder="First name" required/>
</div>
<div class="form-group">
<label for="middleName">Middle Name</label>
<input type="text" id="middleName" name="middleName" placeholder="Middle name" />
</div>
<div class="form-group">
<label for="lastName">Last Name <span class="required">*</span></label>
<input type="text" id="lastName" name="lastName" placeholder="Last name" required />
</div>
</div>
<!-- Row 2: Present Address + Photo Upload -->
<div class="form-row">
<div class="form-group">
<label for="presentAddress">Present Address</label>
<input type="text" id="presentAddress" name="presentAddress" placeholder="Enter your current address" />
</div>
<div class="form-group">
<label for="photoUpload1">Upload Photo <span class="file-note">(PDF, JPEG, PNG)</span><span class="required">*</span></label>
<input type="file" id="photoUpload1" name="photoUpload1" accept=".pdf, .jpg, .jpeg, .png" />
</div>
</div>
<!-- Row 3: Permanent Address + Photo Upload -->
<div class="form-row">
<div class="form-group">
<label for="permanentAddress">Permanent Address</label>
<input type="text" id="permanentAddress" name="permanentAddress" placeholder="Enter your permanent address" />
</div>
</div>
<!-- Row 4: Email ID -->
<div class="form-row full-width">
<label for="email">Email ID<span class="required">*</span></label>
<input type="email" id="email" name="email" placeholder="Enter your email address" required />
</div>
<!-- Row 5: Hobbies -->
<div class="form-row full-width">
<label for="hobbies">Hobbies<span class="required">*</span></label>
<input type="text" id="hobbies" name="hobbies" placeholder="Enter your hobbies" required />
</div>
<!-- Row 6: Residential and Mobile Number -->
<div class="form-row">
<div class="form-group">
<label for="residentialNumber">Residential Number<span class="required">*</span></label>
<input type="tel" id="residentialNumber" name="residentialNumber" placeholder="Enter landline number" />
</div>
<div class="form-group">
<label for="mobileNumber">Mobile Number<span class="required">*</span></label>
<input type="tel" id="mobileNumber" name="mobileNumber" placeholder="Enter mobile number" />
</div>
</div>
<!-- Row 7: Date of Birth + Place of Birth -->
<div class="form-row">
<div class="form-group">
<label for="dob">Date of Birth <span class="file-note">(DD/MM/YYYY)</span><span class="required">*</span></label>
<input type="date" id="dob" name="dob" required placeholder="DD/MM/YYYY"/>
</div>
<div class="form-group">
<label for="birthPlace">Place of Birth</label>
<input type="text" id="birthPlace" name="birthPlace" placeholder="Enter place of birth"/>
</div>
</div>
<!-- Row 8: Gender & Religion -->
<div class="form-row">
<div class="form-group">
<label for="gender">Gender</label>
<select id="gender" name="gender">
<option value="">Select Gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
</div>
<div class="form-group">
<label for="religion">Religion</label>
<input type="text" id="religion" name="religion" placeholder="Enter religion" />
</div>
</div>
<!-- Row 9: Nationality & Blood Group -->
<div class="form-row">
<div class="form-group">
<label for="nationality">Nationality</label>
<input type="text" id="nationality" name="nationality" placeholder="Enter nationality" />
</div>
<div class="form-group">
<label for="bloodGroup">Blood Group</label>
<select id="bloodGroup" name="bloodGroup">
<option value="">Select Blood Group</option>
<option value="A+">A+</option>
<option value="A-">A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="O+">O+</option>
<option value="O-">O-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option>
</select>
</div>
</div>
<!-- Row 10: Marital Status & Date of Marriage -->
<div class="form-row">
<div class="form-group">
<label for="maritalStatus">Marital Status</label>
<select id="maritalStatus" name="maritalStatus">
<option value="">Select Marital Status</option>
<option value="single">Single</option>
<option value="married">Married</option>
<option value="divorced">Divorced</option>
<option value="widowed">Widowed</option>
</select>
</div>
<div class="form-group">
<label for="marriageDate">Date of Marriage</label>
<input type="date" id="marriageDate" name="marriageDate" placeholder="DD/MM/YYYY" />
</div>
</div>
<!-- Row 11: Father's Name & Mother Tongue -->
<div class="form-row">
<div class="form-group">
<label for="fatherName">Father’s Name</label>
<input type="text" id="fatherName" name="fatherName" placeholder="Enter father's name" />
</div>
<div class="form-group">
<label for="motherTongue">Mother Tongue</label>
<input type="text" id="motherTongue" name="motherTongue" placeholder="Enter mother tongue" />
</div>
</div>
</form>
</div>
<!-- Form Section -->
<div class="form-section">
<h3>Language Proficiency</h3><br>
<!-- Row 1: Name Fields -->
<div class="table-container">
<table class="employment-table" id="languageTable">
<thead>
<tr>
<th>Language Known</th>
<th>Read</th>
<th>Speak</th>
<th>Write</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" name="language[]" placeholder="Enter language" /></td>
<td style="text-align: center;"><input type="checkbox" name="read[]" /></td>
<td style="text-align: center;"><input type="checkbox" name="speak[]" /></td>
<td style="text-align: center;"><input type="checkbox" name="write[]" /></td>
<td>
<button type="button" class="add-row" onclick="addLanguageRow()">+</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script>
function addLanguageRow() {
const table = document.querySelector("#languageTable tbody");
const newRow = document.createElement("tr");
newRow.innerHTML = `
<td><input type="text" name="language[]" placeholder="Enter language" /></td>
<td style="text-align: center;"><input type="checkbox" name="read[]" /></td>
<td style="text-align: center;"><input type="checkbox" name="speak[]" /></td>
<td style="text-align: center;"><input type="checkbox" name="write[]" /></td>
<td>
<button type="button" class="remove-row" onclick="removeRow(this)">-</button>
</td>
`;
table.appendChild(newRow);
}
</script>
<!-- FAMILY DETAILS Section -->
<div class="form-section">
<h3>Family Details</h3>
<div class="table-container">
<table class="family-table">
<thead>
<tr>
<th>Relationship</th>
<th>Name</th>
<th>Date of Birth</th>
<th>Gender</th>
<th>Occupation</th>
</tr>
</thead>
<tbody>
<tr>
<td>Father</td>
<td><input type="text" name="fatherName" placeholder="Full Name" /></td>
<td><input type="date" name="fatherDOB" /></td>
<td>
<select name="fatherGender">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td><input type="text" name="fatherOccupation" placeholder="Occupation" /></td>
</tr>
<tr>
<td>Mother</td>
<td><input type="text" name="motherName" placeholder="Full Name" /></td>
<td><input type="date" name="motherDOB" /></td>
<td>
<select name="motherGender">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td><input type="text" name="motherOccupation" placeholder="Occupation" /></td>
</tr>
<tr>
<td>Spouse</td>
<td><input type="text" name="spouseName" placeholder="Full Name" /></td>
<td><input type="date" name="spouseDOB" /></td>
<td>
<select name="spouseGender">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td><input type="text" name="spouseOccupation" placeholder="Occupation" /></td>
</tr>
<tr>
<td>Child 1</td>
<td><input type="text" name="child1Name" placeholder="Full Name" /></td>
<td><input type="date" name="child1DOB" /></td>
<td>
<select name="child1Gender">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td><input type="text" name="child1Occupation" placeholder="Occupation" /></td>
</tr>
<tr>
<td>Child 2</td>
<td><input type="text" name="child2Name" placeholder="Full Name" /></td>
<td><input type="date" name="child2DOB" /></td>
<td>
<select name="child2Gender">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</td>
<td><input type="text" name="child2Occupation" placeholder="Occupation" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
</div>
<!-- EMERGENCY CONTACT SECTION -->
<div class="form-section">
<h3>Emergency Contact</h3><br>
<!-- Name -->
<div class="form-row full-width">
<div class="form-group">
<label for="emergencyName">Name</label>
<input type="text" id="emergencyName" name="emergencyName" placeholder="Enter full name" required />
</div>
</div>
<!-- Relationship and Phone Number -->
<div class="form-row">
<div class="form-group">
<label for="emergencyRelation">Relationship</label>
<input type="text" id="emergencyRelation" name="emergencyRelation" placeholder="e.g. Father, Friend" />
</div>
<div class="form-group">
<label for="emergencyPhone">Phone Number</label>
<input type="tel" id="emergencyPhone" name="emergencyPhone" placeholder="Enter contact number" required />
</div>
</div>
<!-- Contact Address -->
<div class="form-row full-width">
<div class="form-group">
<label for="emergencyAddress">Contact Address</label>
<input type="text" id="emergencyAddress" name="emergencyAddress" placeholder="Enter address" />
</div>
</div>
</div>
<!-- BANK ACCOUNT DETAILS -->
<div class="form-section">
<h3>Bank Account Details</h3><br>
<div class="form-row full-width">
<div class="form-group">
<label for="accountName">Name as per Records</label>
<input type="text" id="accountName" name="accountName" placeholder="Enter full name on bank account" />
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="accountNumber">Bank Account Number</label>
<input type="text" id="accountNumber" name="accountNumber" placeholder="Enter account number" />
</div>
<div class="form-group">
<label for="ifscCode">IFSC Code</label>
<input type="text" id="ifscCode" name="ifscCode" placeholder="Enter IFSC code" />
</div>
</div>
<div class="form-row full-width">
<div class="form-group">
<label for="branchAddress">Branch Address</label>
<input type="text" id="branchAddress" name="branchAddress" placeholder="Enter bank branch address" />
</div>
</div>
</div>
<!-- GOVT. ID DETAILS -->
<div class="form-section">
<h3>Government ID Details <span style="color:red;">(* Mandatory)</span></h3><br>
<div class="form-row">
<div class="form-group">
<label for="panNumber">PAN Card No <span class="required">*</span></label>
<input type="text" id="panNumber" name="panNumber" placeholder="Enter PAN card number" required />
</div>
<div class="form-group">
<label for="aadharNumber">Aadhar Number<span class="required">*</span></label>
<input type="text" id="aadharNumber" name="aadharNumber" placeholder="Enter Aadhar number" required />
</div>
</div>
<div class="form-row full-width">
<div class="form-group">
<label for="otherId">Any Other ID Proof (Driving License / Passport / Voter’s Card) <span class="required">*</label>
<input type="text" id="otherId" name="otherId" placeholder="Enter alternate ID proof (optional)" required />
</div>
</div>
</div>
<!-- EDUCATION DETAILS SECTION -->
<div class="form-section">
<h3>Education Details (in Descending Order)</h3>
<div class="table-container">
<table class="education-table">
<thead>
<tr>
<th>Qualification</th>
<th>Specialisation</th>
<th>Institute / University</th>
<th>From (DD/MM/YY)</th>
<th>To (DD/MM/YY)</th>
<th>% / Grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>Postgraduation</td>
<td><input type="text" name="pgSpecialisation" /></td>
<td><input type="text" name="pgInstitute" /></td>
<td><input type="date" name="pgFrom" /></td>
<td><input type="date" name="pgTo" /></td>
<td><input type="text" name="pgGrade" /></td>
</tr>
<tr>
<td>Undergraduation</td>
<td><input type="text" name="degreeSpecialisation" /></td>
<td><input type="text" name="degreeInstitute" /></td>
<td><input type="date" name="degreeFrom" /></td>
<td><input type="date" name="degreeTo" /></td>
<td><input type="text" name="degreeGrade" /></td>
</tr>
<tr>
<td>HSC</td>
<td><input type="text" name="hscSpecialisation" /></td>
<td><input type="text" name="hscInstitute" /></td>
<td><input type="date" name="hscFrom" /></td>
<td><input type="date" name="hscTo" /></td>
<td><input type="text" name="hscGrade" /></td>
</tr>
<tr>
<td>SSC</td>
<td><input type="text" name="sscSpecialisation" /></td>
<td><input type="text" name="sscInstitute" /></td>
<td><input type="date" name="sscFrom" /></td>
<td><input type="date" name="sscTo" /></td>
<td><input type="text" name="sscGrade" /></td>
</tr>
<tr>
<td>Diploma</td>
<td><input type="text" name="diplomaSpecialisation" /></td>
<td><input type="text" name="diplomaInstitute" /></td>
<td><input type="date" name="diplomaFrom" /></td>
<td><input type="date" name="diplomaTo" /></td>
<td><input type="text" name="diplomaGrade" /></td>
</tr>
<tr>
<td>Others</td>
<td><input type="text" name="otherSpecialisation" /></td>
<td><input type="text" name="otherInstitute" /></td>
<td><input type="date" name="otherFrom" /></td>
<td><input type="date" name="otherTo" /></td>
<td><input type="text" name="otherGrade" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- EMPLOYMENT DETAILS SECTION -->
<div class="form-section">
<h3>Employment Details (in Descending Order)</h3>
<div class="table-container">
<table class="employment-table" id="employmentTable">
<thead>
<tr>
<th>Organisation</th>
<th>Designation</th>
<th>From</th>
<th>To</th>
<th>CTC</th>
<th>Reason for Leaving</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" name="organisation[]" placeholder="Enter organization name"/></td>
<td><input type="text" name="designation[]" placeholder="Enter designation"/></td>
<td><input type="date" name="fromDate[]" /></td>
<td><input type="date" name="toDate[]" /></td>
<td><input type="text" name="ctc[]" placeholder="Enter ctc"/></td>
<td><input type="text" name="reason[]" placeholder="Enter reason"/></td>
<td>
<button type="button" class="add-row" onclick="addEmploymentRow()">+</i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- PROFESSIONAL REFERENCE SECTION -->
<div class="form-section">
<h3>Professional Reference</h3>
<div class="table-container">
<table class="employment-table" id="referenceTable">
<thead>
<tr>
<th>Name</th>
<th>Organisation</th>
<th>Designation</th>
<th>Contact Number</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" name="refName[]" /></td>
<td><input type="text" name="refOrg[]" /></td>
<td><input type="text" name="refDesignation[]" /></td>
<td><input type="text" name="refContact[]" /></td>
<td>
<button type="button" class="add-row" onclick="addReferenceRow()">+
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- RELATIVES IN GROUP SECTION -->
<div class="form-section">
<h3>Relatives in Group</h3>
<div class="table-container">
<table class="employment-table" id="relativesTable">
<thead>
<tr>
<th>Name</th>
<th>Organisation</th>
<th>Relationship</th>
<th>Contact</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" name="relName[]" /></td>
<td><input type="text" name="relOrg[]" /></td>
<td><input type="text" name="relRelation[]" /></td>
<td><input type="text" name="relContact[]" /></td>
<td>
<button type="button" class="add-row" onclick="addRelativesRow()">+
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- STRUCTURE OF TEAM SECTION -->
<div class="form-section">
<h3>Structure of Your Team in Previous Organisation</h3><br>
<p>(Please mention names, designations & contact numbers)</p>
<div class="form-row full-width">
<textarea name="teamStructure" rows="5" placeholder="Write here..." class="expandable-textarea"></textarea>
</div>
<p class="declaration-text">
<strong>DECLARATION:</strong> I hereby certify that the above information given by me is correct. I shall be liable in case any information furnished by me is found false or incorrect. The management may take any action against me as deemed fit including termination of my services.
</p><br>
<div class="form-row">
<div class="form-group">
<label for="declarationDate">Date:</label>
<input type="date" id="declarationDate" name="declarationDate" />
</div>
<div class="form-group">
<label for="declarationPlace">Place:</label>
<input type="text" id="declarationPlace" name="declarationPlace" placeholder="Enter place" />
</div>
<div class="form-group">
<label for="signUpload1">Signature of Applicant<span class="file-note"> (pdf, jpeg, png)</span><span class="required">*</span></label>
<input type="file" id="photoUpload1" name="photoUpload1" accept=".pdf, .jpg, .jpeg, .png" />
</div>
</div>
</div>
<!-- GROUP TERM LIFE INSURANCE COVER SECTION -->
<div class="form-section">
<h3>Group Term Life Insurance Cover <span style="font-size: 0.9rem; font-weight: normal;">(For Employees Only)</span></h3>
<div class="form-row">
<div class="form-group">
<label for="empNumber">Emp No.</label>
<input type="text" id="empNumber" name="empNumber" placeholder="Enter employee number" />
</div>
<div class="form-group">
<label for="empName">Name</label>
<input type="text" id="empName" name="empName" placeholder="Enter full name" />
</div>
<div class="form-group">
<label for="empAge">Age</label>
<input type="number" id="empAge" name="empAge" placeholder="Enter age" />
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="empGrade">Grade</label>
<input type="text" id="empGrade" name="empGrade" placeholder="Enter grade" />
</div>
<div class="form-group">
<label for="empDOJ">Date of Joining</label>
<input type="date" id="empDOJ" name="empDOJ" />
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="signUpload2">Signature <span class="file-note">(pdf, jpeg, png)</span><span class="required">*</span></label>
<input type="file" id="photoUpload1" name="photoUpload1" accept=".pdf, .jpg, .jpeg, .png" />
</div>
<div class="form-group">
<label for="personnel">Personnel Department</label>
<input type="text" id="personnel" name="personnel" placeholder="Personnel department signature/remarks" />
</div>
<div class="form-group">
<label for="insuranceDate">Date</label>
<input type="date" id="insuranceDate" name="insuranceDate" />
</div>
</div>
</div>
<div class="form-buttons">
<button type="reset" class="clear-btn">Clear</button>
<a href="nomination.html">
<button type="submit" class="submit-btn">Save and Next</button>
</a>
</div>
</form>
<script>
// Common Row Removal
function removeRow(button) {
const row = button.closest("tr");
row.remove();
}
// EMPLOYMENT SECTION: Adds to employmentTable
function addEmploymentRow() {
const table = document.querySelector("#employmentTable tbody");
const newRow = document.createElement("tr");
newRow.innerHTML = `
<td><input type="text" name="organisation[]" /></td>
<td><input type="text" name="designation[]" /></td>
<td><input type="date" name="fromDate[]" /></td>
<td><input type="date" name="toDate[]" /></td>
<td><input type="text" name="ctc[]" /></td>
<td><input type="text" name="reason[]" /></td>
<td><button type="button" class="remove-row" onclick="removeRow(this)">-</button></td>
`;
table.appendChild(newRow);
}
// PROFESSIONAL REFERENCE SECTION: Adds to referenceTable
function addReferenceRow() {
const table = document.querySelector("#referenceTable tbody");
const newRow = document.createElement("tr");
newRow.innerHTML = `
<td><input type="text" name="refName[]" /></td>
<td><input type="text" name="refOrg[]" /></td>
<td><input type="text" name="refDesignation[]" /></td>
<td><input type="text" name="refContact[]" /></td>
<td><button type="button" class="remove-row" onclick="removeRow(this)">-</button></td>
`;
table.appendChild(newRow);
}
// RELATIVES SECTION: Adds to relativesTable
function addRelativesRow() {
const table = document.querySelector("#relativesTable tbody");
const newRow = document.createElement("tr");
newRow.innerHTML = `
<td><input type="text" name="relName[]" /></td>
<td><input type="text" name="relOrg[]" /></td>
<td><input type="text" name="relRelation[]" /></td>
<td><input type="text" name="relContact[]" /></td>
<td><button type="button" class="remove-row" onclick="removeRow(this)">-</button></td>
`;
table.appendChild(newRow);
}
document.getElementById("employeeForm").addEventListener("submit", function(event) {
event.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData.entries());
fetch("http://localhost:8080/api/employees", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
// Optionally store returned ID in localStorage/sessionStorage
window.location.href = "nomination.html";
})
.catch(error => console.error("Error:", error));
});
</script>
</body>
</html>