-
Notifications
You must be signed in to change notification settings - Fork 0
/
secretary.html
40 lines (39 loc) · 1.68 KB
/
secretary.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vote for Secretary</title>
<link rel="stylesheet" href="styles.css">
<script src="voting.js"></script>
</head>
<body>
<nav class="navbar">
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="president.html">Vote for President</a></li>
<li><a href="results.html">Voting Results</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</nav>
<div class="container">
<h1>Vote for Secretary</h1>
<form action="#" method="post" class="voting-form" onsubmit="castVote('Secretary', this.secretary.value, '/treasurer.html'); return false;">
<label for="secretary">Select your candidate for Secretary:</label><br>
<input type="radio" id="candidate1" name="secretary" value="1" checked>
<label for="candidate1">Candidate 1</label><br>
<input type="radio" id="candidate2" name="secretary" value="2">
<label for="candidate2">Candidate 2</label><br>
<input type="submit" value="Submit Vote" class="submit-btn">
</form>
</div>
<script>
// Retrieve the voted value from local storage
const votedCandidate = localStorage.getItem('Secretary');
// If a candidate was voted for Secretary, pre-select the corresponding option
if (votedCandidate) {
document.querySelector(`input[name="secretary"][value="${votedCandidate}"]`).checked = true;
}
</script>
</body>
</html>