-
Notifications
You must be signed in to change notification settings - Fork 0
/
Doctor_details.html
169 lines (146 loc) · 5.08 KB
/
Doctor_details.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Page</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
nav {
background-color: #264488;
overflow: hidden;
padding: 10px 0;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
nav ul li {
display: inline;
}
nav ul li a {
display: inline-block;
color: white;
padding: 14px 20px;
text-decoration: none;
}
nav ul li a:hover {
background-color: #264488;
}
section {
margin: 20px;
}
h2 {
color: #264488;
}
form {
margin-top: 10px;
}
label {
display: inline-block;
width: 150px;
}
input[type="text"],
input[type="date"],
input[type="file"],
select {
width: 300px;
padding: 8px;
margin: 5px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #264488;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #264488;
}
.required {
color: red;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav>
<ul>
<li><a href="#doctor_details">Doctor Details</a></li>
<!-- <li><a href="#contact_details">Contact Details</a></li> -->
</ul>
</nav>
<!-- Doctor Details -->
<section id="doctor_details">
<h2>Doctor Details</h2>
<form id="registrationForm" action="#" method="post">
<label for="title">Title:</label>
<select name="title" id="title">
<option value="Dr.">Dr.</option>
<!-- <option value="Prof.">Ms.</option> -->
</select>
<br>
<label for="full_name">Full Name:</label><span class="required">*</span>
<input type="text" id="full_name" name="full_name" required>
<br>
<label for="dob">Date of Birth:</label><span class="required">*</span>
<input type="date" id="dob" name="dob" required>
<br>
<label for="gender">Gender:</label><span class="required">*</span>
<input type="radio" id="male" name="gender" value="male" required>
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
<input type="radio" id="other" name="gender" value="other">
<label for="other">Other</label>
<br>
<label for="education">Education:</label><span class="required">*</span>
<input type="text" id="education" name="education" required>
<br>
<label for="address1">Address :</label><span class="required">*</span>
<input type="text" id="address1" name="address1" required>
<br>
<label for="photo">Upload Your Photo:</label>
<input type="file" id="photo" name="photo">
<br>
<input type="submit" value="Save">
</form>
</section>
<!-- Automatic ID Generator -->
<script>
// Function to generate a 12-digit ID with passport number
function generateID(passportNumber) {
var id = passportNumber.replace(/\D/g,''); // Extract only digits from passport number
id = id.padEnd(12, '0'); // Pad with zeros if passport number is shorter than 12 digits
return id;
}
// Function to handle form submission
function handleSubmit(event) {
event.preventDefault(); // Prevent form submission
// Get passport number from the form
var passportNumber = document.getElementById("passport_number").value;
// Generate ID
var generatedID = generateID(passportNumber);
// Display generated ID
console.log("Generated ID:", generatedID);
alert("Generated ID: " + generatedID);
// Optionally, you can submit the form here
// document.getElementById("registrationForm").submit();
}
// Add event listener to form submission
document.getElementById("registrationForm").addEventListener("submit", handleSubmit);
</script>
</body>
</html>