forked from lucaspatenaude/ScoreSpot
Merge branch 'main' of https://github.com/LucasPatenaude/ScoreSpot
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
<body class="container">
|
||||
<div class="register-page">
|
||||
<div class="form-container">
|
||||
<h1 class="mt-5 mb-4">Register</h1>
|
||||
@@ -34,47 +33,4 @@
|
||||
<p class="mt-3">Already have an account? <a href="/login">Login</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
|
||||
const league_select = document.getElementById('league_dropdown');
|
||||
const team_select = document.getElementById('team_dropdown');
|
||||
|
||||
league_select.addEventListener('change', updateTeamSelect);
|
||||
|
||||
function updateTeamSelect() {
|
||||
var selectedLeague = league_select.value;
|
||||
var teamSelect = team_select;
|
||||
|
||||
// Clear existing options
|
||||
teamSelect.innerHTML = "";
|
||||
|
||||
// Add options based on the selected value from the first select element
|
||||
if (selectedLeague === "La Liga") {
|
||||
// Add options for La Liga
|
||||
addOption(teamSelect, "Option 1 for LL", "option1A");
|
||||
addOption(teamSelect, "Option 2 for LL", "option2A");
|
||||
} else if (selectedLeague === "Serie A") {
|
||||
// Add options for Serie A
|
||||
addOption(teamSelect, "Team 1 in Serie A", "option1B");
|
||||
addOption(teamSelect, "Team 2 in Serie A", "option2B");
|
||||
} else {
|
||||
// Add options for Bundesliga
|
||||
addOption(teamSelect, "Option 1 for Bun", "option1C");
|
||||
addOption(teamSelect, "Option 2 for Bun", "option2C");
|
||||
}
|
||||
}
|
||||
|
||||
function addOption(selectElement, text, value) {
|
||||
var option = document.createElement("option");
|
||||
option.text = text;
|
||||
option.value = value;
|
||||
selectElement.add(option);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user