-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.html
34 lines (34 loc) · 1.28 KB
/
data.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submitted Data</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 20px; }
.container { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); }
pre { background: #eee; padding: 10px; border-radius: 5px; }
</style>
</head>
<body>
<div class="container">
<h2>Submitted Data</h2>
<pre id="data"></pre>
<a href="contact.html">Go back to the contact form</a>
</div>
<script>
window.onload = function() {
const formDataList = JSON.parse(localStorage.getItem('formDataList')) || [];
let formattedData = '';
formDataList.forEach((data, index) => {
formattedData += `Entry ${index + 1}:\n`;
formattedData += `Name: ${data.name}\n`;
formattedData += `Email: ${data.email}\n`;
formattedData += `Number: ${data.number}\n`;
formattedData += `Details: ${data.details}\n\n`;
});
document.getElementById('data').innerText = formattedData;
};
</script>
</body>
</html>