-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata_colln.html
60 lines (60 loc) · 2.54 KB
/
data_colln.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LuxeRide Rentals</title>
<link rel="stylesheet" href="form.css">
</head>
<body>
<div class="container">
<h1>Data Collection Form</h1>
<div class="input">
<form id="form_">
<p>Name:<input type="text" name="Name" id="name" placeholder="Enter your name" required></p>
<p>Mobile Number: <input type="text" name="Mobile Number" id="no" required placeholder="National code is a must"><sub>like +91, +911, etc.</sub></p>
<p>License:<input type="file" id="img" required></p>
<p>License ID: <input type="text" name="License" id="license" required maxlength="16"></p>
<p>Nationality Proof:<input type="file" id="pii" required></p>
<button type="submit" id="send" onclick="return validate()">Submit</button>
</form>
<div style="margin-top: 15px;margin-left: 170px;">
<a href="index.html" style="color: white;font-size: 20px;text-decoration: none;background-color: navy;padding: 10px 12px;border-radius: 10px;">Back</a>
</div>
</div>
</div>
<script>
function validate() {
const name = document.getElementById('name');
const number = document.getElementById('no');
const licenseID = document.getElementById('license');
if (name.value.trim() === "") {
alert("No blank allowed in name");
name.style.borderBottom = "solid 3px red";
return false;
} else {
name.style.borderBottom = "";
}
if (number.value.trim() === "") {
alert("No blank allowed in mobile number");
number.style.borderBottom = "solid 3px red";
return false;
} else {
number.style.borderBottom = "";
}
if (licenseID.value.trim() === "") {
alert("Invalid License ID");
licenseID.style.borderBottom = "solid 3px red";
return false;
} else if (licenseID.value.trim().length < 8) {
alert("License ID length is too short");
licenseID.style.borderBottom = "solid 3px red";
return false;
} else {
licenseID.style.borderBottom = "";
}
return true;
}
</script>
</body>
</html>