-
Notifications
You must be signed in to change notification settings - Fork 0
/
form_submitted.html
55 lines (47 loc) · 1.8 KB
/
form_submitted.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="Style/feedback_form.css" type="text/css">
<title>Document</title>
</head>
<body>
<main>
<div class="feedback_box">
<h2>Thank you for your Request</h2>
<p><span class="form_data" id="firstName"></span> <span class="form_data" id="surname"></span></p><br>
<h2>We will contact you shortly on your email</h2>
<p><span class="form_data" id="email"></span> </p>
</div>
<div id="redirect">
<p>You are going to be redirected to the main page in <span id="seconds">5</span> sec</p>
</div>
</main>
<script>
//displaying the value from local storage to another page by their respective Ids
document.getElementById("firstName").innerHTML=localStorage.getItem("fn");
document.getElementById("surname").innerHTML=localStorage.getItem("sur");
document.getElementById("email").innerHTML=localStorage.getItem("em");
var seconds = 5; // seconds for HTML
var update; // variable for clearInterval() function
function redirect() {
document.location.href = 'index.html';
}
function updateSecs() {
document.getElementById("seconds").innerHTML = seconds;
seconds--;
if (seconds == -1) {
clearInterval(update);
redirect();
}
}
function countdownTimer() {
update = setInterval(function () {
updateSecs()
}, 1000);
}
countdownTimer();
</script>
</body>
</html>