-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOtpVerification.jsp
More file actions
58 lines (52 loc) · 2.39 KB
/
OtpVerification.jsp
File metadata and controls
58 lines (52 loc) · 2.39 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
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OTP Verification</title>
<link rel="stylesheet" href="css/OTP_style.css">
</head>
<body>
<!-- Navbar -->
<nav class="navbar">
<div class="logo">Pollify</div>
<div class="menu">
<div><a href="#">Home</a></div>
<div><a href="#">Register</a></div>
<div><a href="#">Contact</a></div>
</div>
</nav>
<!-- OTP Verification Form -->
<div class="otp-container">
<h2>Please enter the One-Time Password to verify your account</h2>
<p>A One-Time Password has been sent to your Email</p>
<form class="otp-form" action="verify-otp" method="post" onsubmit="combineOTP()">
<input type="hidden" name="email" value="${email}"> <!-- Assuming email is stored in session or passed via form -->
<!-- Hidden field to store the combined OTP -->
<input type="hidden" name="otp" id="otp" value="">
<div class="otp-inputs">
<!-- Six separate input fields for the OTP -->
<input type="text" maxlength="1" class="otp-input" id="otp1" required>
<input type="text" maxlength="1" class="otp-input" id="otp2" required>
<input type="text" maxlength="1" class="otp-input" id="otp3" required>
<input type="text" maxlength="1" class="otp-input" id="otp4" required>
<input type="text" maxlength="1" class="otp-input" id="otp5" required>
<input type="text" maxlength="1" class="otp-input" id="otp6" required>
</div>
<button type="submit" class="submit-btn">Validate</button>
</form>
<p class="resend">Resend One-Time Password<br><a href="#">Entered a wrong Email?</a></p>
</div>
<script>
// Function to combine the 6 separate OTP fields into one hidden input field before submission
function combineOTP() {
var otp = '';
for (var i = 1; i <= 6; i++) {
otp += document.getElementById('otp' + i).value;
}
document.getElementById('otp').value = otp;
}
</script>
<script src="JS/OTP_script.js"></script>
</body>
</html>