I have a databse with different gym exercises, im trying to make a leaderboard for each one, and i want something like a checkbox form that takes all the exercises from my databse and adds them as check buttons, and as you check them, i want them to apear the the navbar as options to click.
I´m doing it manually but i wat it to be dynamic and i have no idea how to do it
I´m using bootstrap5 and this is what i have now, I´d be thankful for any tips or sugestions
<div class="collapse navbar-collapse justify-content-center" id="navbarCategories">
<ul class="navbar-nav" id="navbar">
<li class="nav-item"><a href="#squats" class="nav-link" style="color: #c5c6c8;">Squats</a></li>
<li class="nav-item"><a href="#deadlifts" class="nav-link" style="color: #c5c6c8;">Deadlifts</a></li>
<li class="nav-item"><a href="#benchpress" class="nav-link" style="color: #c5c6c8;">Bench Press</a></li>
<li class="nav-item"><a href="#overheadpress" class="nav-link" style="color: #c5c6c8;">Overhead Press</a></li>
<div class="dropdown">
<button class="nav-link btn btn-primry dropdown-toggle"data-bs-toggle="dropdown" style="color: #c5c6c8;">Add favorite</button></li>
<ul class="dropdown-menu">
<form id="checkform">
<input type="checkbox" id="benchpress" name="benchpress" value="Bench Press">
<label for="benchpress">Bench Press</label><br>
<input type="checkbox" id="deadlift" name="deadlift" value="Deadlifts">
<label for="deadlift">Deadlifts</label><br>
<input type="checkbox" id="overheadpress" name="overheadpress" value="Overhead Press">
<label for="overheadpress">Overhead Press</label><br><br>
<input type="submit" value="Submit">
</form>
</ul>
</div>
</ul>
</div>
simp aroni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.